我把“superdullwolf(超级大笨狼)”的第一个文件修改了一下,你看是不是更好用了。哈哈,我也学了一招^_^ <OBJECT id=menu1 onmouseover="menu1.style.display=''" style="DISPLAY: none; Z-INDEX: 1000; POSITION: absolute; HEIGHT: 150px"; onmouseout="menu1.style.display='none'" type=text/x-scriptlet data=caidan.htm VIEWASTEXT> </OBJECT><SCRIPT language=vbscript> function document_oncontextmenu() document_oncontextmenu=false menu1.style.LEFT=window.event.x-20 if screen.width-window.event.x<150 then menu1.style.LEFT=window.event.x-150 end if menu1.style.TOP=window.event.y-20 if screen.Height-window.event.y<280 then menu1.style.TOP=window.event.y-120 end if menu1.style.display="" end function </SCRIPT>
去
51js.com
找找
哪位有这方面的代码让我看一下好么,jsp的也行
[email protected]
建议找本基础的书好好看看,就明白了,你问错了问题,兄弟。
不过没关系,我开始时还不如你呢!
<OBJECT
id=menu1
onmouseover="menu1.style.display=''"
style=" POSITION: ABSOLUTE;DISPLAY: none; Z-INDEX: 1000; HEIGHT: 200px"
onmouseout="menu1.style.display='none'"
type=text/x-scriptlet
data=caidan.htm
VIEWASTEXT>
</OBJECT>
<SCRIPT LANGUAGE=vbscript >
function document_oncontextmenu()
document_oncontextmenu=false
menu1.style.LEFT=window.event.x
menu1.style.TOP=window.event.y
menu1.style.display=""
end function
</SCRIPT>
文件2:
caidan.htm
<div style='position:absolute;left:0;top:0;width:152;height:200;font:14;color:white;background:black;border:1 solid black'>
<div onclick="alert(this.innerText)">菜单1</div>
<div onclick="alert(this.innerText)">菜单2</div>
<div onclick="alert(this.innerText)">菜单3</div>
<div onclick="alert(this.innerText)">菜单4</div>
<div onclick="alert(this.innerText)">菜单5</div>
<div onclick="alert(this.innerText)">菜单6</div>
<div onclick="alert(this.innerText)">菜单7</div>
</div>
演示:
www.adr.gov.cn/download/Rmenu.htm
这个菜单还有个好处,不会被<select>标签遮挡哦!~~
一般div不会有这个效果
<OBJECT id=menu1
onmouseover="menu1.style.display=''"
style="DISPLAY: none;
Z-INDEX: 1000;
POSITION: absolute;
HEIGHT: 150px";
onmouseout="menu1.style.display='none'"
type=text/x-scriptlet
data=caidan.htm
VIEWASTEXT>
</OBJECT><SCRIPT language=vbscript>
function document_oncontextmenu()
document_oncontextmenu=false
menu1.style.LEFT=window.event.x-20
if screen.width-window.event.x<150 then
menu1.style.LEFT=window.event.x-150
end if
menu1.style.TOP=window.event.y-20
if screen.Height-window.event.y<280 then
menu1.style.TOP=window.event.y-120
end if
menu1.style.display=""
end function
</SCRIPT>
关键在oncontextmenu="event.returnValue=false"这句。