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()\ "> ·µ»Ø </div> "
strMenu += " <div class=\ "menuitems\ " onClick=\ "javascript:history.forward()\ "> Ç°½ø </div> "
strMenu += " <div class=\ "menuitems\ " onClick=\ "javascript:location.reload()\ "> ˢР</div> "
strMenu += " <div class=\ "menuitems\ " onClick=\ "javascript:print()\ "> ´òÓ¡ </div> "
strMenu += " <hr color=#999999 size=1> "
strMenu += " <div class=\ "menuitems\ " onClick=\ "javascript:location.href= 'index.html '\ "> ϵͳÊ×Ò³ </div> "
strMenu += " <div class=\ "menuitems\ " onClick=\ "javascript:location.href= 'map.html '\ "> ϵͳ°ïÖú </div> "
//strMenu += " <div class=\ "menuitems\ " onClick=\ "javascript:location.href= 'feedback.html '\ "> D??¡é¡¤¡ä¨¤? </div> "
//strMenu += " <div class=\ "menuitems\ " onClick=\ "javascript:location.href= 'job.html '\ "> 3???¨®¡é2? </a> </div> "
strMenu += " <div class=\ "menuitems\ " onClick=\ "javascript:location.href= 'mailto:scutde@21cn.com '\ "> ÁªÏµÎÒÃÇ </a> </div> "
strMenu += " <div class=\ "menuitems\ " onClick=\ "javascript:location.href= 'law.html '\ "> Í˳öϵͳ </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 "