事件对象 获得 使用 冒泡 返回值

function getEvent() { return window.event || arguments.callee.caller.arguments[0]; } var myEvent = getEvent(); var x=y=menuOffsetWidth=menuOffsetHeight=0; var redge=document.body.clientWidth-myEvent.clientX; var bedge=document.body.clientHeight-myEvent.clientY; var objRightMenu = document.getElementById("rightMenuContainer"); menuOffsetWidth = objRightMenu.offsetWidth; menuOffsetHeight = objRightMenu.offsetHeight; if(menuOffsetWidth == 0) menuOffsetWidth=200; if(menuOffsetHeight == 0) menuOffsetHeight=200; if (redge<menuOffsetWidth){ x=document.body.scrollLeft + myEvent.clientX-menuOffsetWidth; } else { x=document.body.scrollLeft + myEvent.clientX; } if (bedge<menuOffsetHeight){ y=document.body.scrollTop + myEvent.clientY - menuOffsetHeight; } else { y = document.body.scrollTop + myEvent.clientY; } myEvent.returnValue = false; myEvent.cancelBubble=true;  

你可能感兴趣的:(function)