<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"><title>Example: ContextMenu (YUI Library)</title><link rel="stylesheet" type="text/css" href="../../build/menu/assets/menu.css"><scrīpt type="text/javascrīpt" src="../../build/yahoo/yahoo.js"></scrīpt><scrīpt type="text/javascrīpt" src="../../build/event/event.js"></scrīpt><scrīpt type="text/javascrīpt" src="../../build/dom/dom.js"></scrīpt><scrīpt type="text/javascrīpt" src="../../build/animation/animation.js"></scrīpt><scrīpt type="text/javascrīpt" src="../../build/container/container_core.js"></scrīpt><scrīpt type="text/javascrīpt" src="../../build/menu/menu.js"></scrīpt><scrīpt type="text/javascrīpt">
// "load" event handler for the "window" object
YAHOO.example.onWindowLoad = function(p_oEvent) {
// Clone the first ewe so that we can create more later
var ōLI = document.getElementById("test1");
// Define the items for the ewe context menu
var aMenuItems = [
{ text: "编辑", helptext: "Shift + E" },
{ text: "复制", helptext: "Shift + C" },
{ text: "删除", helptext: "Shift + D" }
];
// Create the ewe context menu
var ōEweContextMenu = new YAHOO.widget.ContextMenu(
"ewecontextmenu",
{
trigger: document.getElementById("test1"),
itemdata: aMenuItems,
lazyload: true,
effect:{
effect:YAHOO.widget.ContainerEffect.FADE,
duration:0.25
}
}
);
}
// Assign a "load" event handler to the window
YAHOO.util.Event.addListener(window, "load", YAHOO.example.onWindowLoad);
</scrīpt></head><body><table width="208" height="77" border="0" cellpadding="0" cellspacing="1" bordercolor="#00FFFF" bgcolor="#CCCCCC"><tr><td width="97" height="20" bgcolor="#F5F5F5"></td><td width="108" bgcolor="#F5F5F5"></td></tr><tr><td height="20" bgcolor="#F5F5F5"></td><td bgcolor="#F5F5F5" id="test1">test</td></tr><tr><td height="20" bgcolor="#F5F5F5"></td><td bgcolor="#F5F5F5"></td></tr></table></body></html>