日期:2014-05-20  浏览次数:20438 次

ASP.NET中奇怪的IE自定义右键菜单问题,请高手解答!!
我在网上下了一个IE自定义右键菜单的JS代码menu0.js
//   JavaScript   Document

var   strMenu   =   " <div   id=\ "menu\ "   class=\ "clsMenu\ "   onMouseover=\ "highlight()\ "   onMouseout=\ "lowlight()\ "> "
strMenu   +=   " <div   class=\ "menuitems\ "   onClick=\ "javascript:history.back()\ "> ·&micro;&raquo;&Oslash; </div> "
strMenu   +=   " <div   class=\ "menuitems\ "   onClick=\ "javascript:history.forward()\ "> &Ccedil;°&frac12;&oslash; </div> "
strMenu   +=   " <div   class=\ "menuitems\ "   onClick=\ "javascript:location.reload()\ "> &Euml;&cent;&ETH;&Acirc; </div> "
strMenu   +=   " <div   class=\ "menuitems\ "   onClick=\ "javascript:print()\ "> &acute;ò&Oacute;&iexcl; </div> "

strMenu   +=   " <hr   color=#999999   size=1> "
strMenu   +=   " <div   class=\ "menuitems\ "   onClick=\ "javascript:location.href= 'index.html '\ "> &Iuml;&micro;&Iacute;&sup3;&Ecirc;×&Ograve;&sup3; </div> "
strMenu   +=   " <div   class=\ "menuitems\ "   onClick=\ "javascript:location.href= 'map.html '\ "> &Iuml;&micro;&Iacute;&sup3;°&iuml;&Ouml;ú </div> "
//strMenu   +=   " <div   class=\ "menuitems\ "   onClick=\ "javascript:location.href= 'feedback.html '\ "> D??&iexcl;é&iexcl;¤&iexcl;&auml;¨¤? </div> "
//strMenu   +=   " <div   class=\ "menuitems\ "   onClick=\ "javascript:location.href= 'job.html '\ "> 3???¨&reg;&iexcl;é2? </a> </div> "

strMenu   +=   " <div   class=\ "menuitems\ "   onClick=\ "javascript:location.href= 'mailto:scutde@21cn.com '\ "> &Aacute;&ordf;&Iuml;&micro;&Icirc;&Ograve;&Atilde;&Ccedil; </a> </div> "
strMenu   +=   " <div   class=\ "menuitems\ "   onClick=\ "javascript:location.href= 'law.html '\ "> &Iacute;&Euml;&sup3;&ouml;&Iuml;&micro;&Iacute;&sup3; </a> </div> "
strMenu   +=   " </div> "

function   ie()   {
if   (navigator.appName== "Microsoft   Internet   Explorer ")   {
return   true;
}   else   {
return   false;
}}

function   showmenu(){
if   (ie()){

var   rightedge=document.body.clientWidth-event.clientX
var   bottomedge=document.body.clientHeight-event.clientY


if   (rightedge <menu.offsetWidth)
menu.style.left=document.body.scrollLeft+event.clientX-menu.offsetWidth
else

menu.style.left=document.body.scrollLeft+event.clientX


if   (bottomedge <menu.offsetHeight)
menu.style.top=document.body.scrollTop+event.clientY-menu.offsetHeight
else
menu.style.top=document.body.scrollTop+event.clientY

menu.style.visibility= "visible "
}
return   false
}


function   hidemenu(){
if   (ie())   menu.style.visibility= "hidden "