日期:2009-09-15  浏览次数:21084 次

<HTML>
<HEAD>
<TITLE>使用JavaScript和CSS制作仿office XP风格的网页右键菜单</TITLE>

<STYLE>
.flyoutLink {
CURSOR: none; FONT-FAMILY: "Verdana", "Arial", "Helvetica"; FONT-SIZE: 14px; PADDING-LEFT: 5px; PADDING-RIGHT: 25px; PADDING-TOP: 1px
}
.skin0 {
BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; VISIBILITY: hidden; BORDER-LEFT: 1px solid; WIDTH: 110px; CURSOR: default; LINE-HEIGHT: 20px; BORDER-BOTTOM: 1px solid; FONT-FAMILY: Verdana; POSITION: absolute; BACKGROUND-COLOR: white
}
.skin1 {
BORDER-RIGHT: buttonhighlight 2px outset; BORDER-TOP: buttonhighlight 2px outset; VISIBILITY: hidden; BORDER-LEFT: buttonhighlight 2px outset; WIDTH: 90px; CURSOR: default; BORDER-BOTTOM: buttonhighlight 2px outset; POSITION: absolute; BACKGROUND-COLOR: white
}
</STYLE>
</HEAD>
<SCRIPT LANGUAGE=JavaScript>

//用于模仿office XP的风格
function MouseOver(src,BackColor)
{
       if (!src.contains(event.fromElement))
        {
            src.bgColor = BackColor;
            src.style.bordercolor = "#000000";
        }
}
function MouseOut(src, BackColor)
{
        if (!src.contains(event.toElement))
        {
            src.bgColor = BackColor;
            src.style.bordercolor = "#000000";
        }
}
function BcMouseOver(src)
{
       if (!src.contains(event.fromElement))
        {
            src.border = 1;
            src.style.bgColor = "#B6BDD2"
        }
}
function BcMouseOut(src)
{
        if (!src.contains(event.toElement))
        {
            src.border = 0;
            src.style.bgColor = "#f1f1f1"
        }
}

//弹出消息
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_popupMsg(msg) { //v1.0
  alert(msg);
}
</script>
<div id=ie5menu style="backgroundColor=white">
    
  <table width="150" border="0" bgcolor="#f1f1f1" bordercolor="#000000" cellpadding="0" cellspacing="0">
    <tr bordercolor="#f1f1f1">
        <td>
    <table width="100%" border="0" cellpadding="0" cellspacing=&q