|
<STRONG><FONT size=2><FONT face=Arial><SPAN class=smalltxt twffan="done"><SPAN class=bold twffan="done">可拖动的菜单</SPAN></SPAN><BR><BR></FONT></FONT></STRONG><SPAN style="FONT-SIZE: 12px" twffan="done"><html><BR><head><title>foolpot2001菜单</title><BR><style><BR>body,td,a {font-size:9pt;color:black}<BR>.none{border:black 1px solid;backgroundp9D9D9;padding-top:2}<BR>.over {border:black 1px solid;background:707888;color:white;padding-top:2}<BR></style><BR></head><BR><body><BR><div style="position:absolute; left: 100; top: 100;cursor: hand" ID=plane onmousedown="down=true;divleft=event.clientX-parseInt(plane.style.left);divtop=event.clientY-parseInt(plane.style.top)" onmouseup="down=false"><BR><div align=center style="position:absolute; left:150px; top:33px; width:100px; height:19px; z-index:1;color:white;background:707888;cursor:move" class="none" onmouseover="menuin();init()" onmouseout="menuout()">可拖动的菜单</div><BR><div align=center id="item1" style="position:absolute; left:50px; top:55px; width:99px; height:19px; z-index:2; filter:alpha(opacity=0)" onmouseover="this.className='over';menuin()"<BR>onmouseout="this.className='none';menuout()" class="none"<BR>>菜单项一</div><BR><div align=center id="item2" style="position:absolute; left:250px; top:77px; width:99px; height:19px; z-index:3;filter:alpha(opacity=0)"<BR>class=none onmouseover="this.className='over';menuin()"<BR>onmouseout="this.className='none';menuout()">菜单项二</div> <BR><div align=center id="item3" style="position:absolute; left:50px; top:99px; width:99px; height:19px; z-index:4; filter:alpha(opacity=0)"<BR>class=none onmouseover="this.className='over';menuin()"<BR>onmouseout="this.className='none';menuout()">菜单项三</div><BR><div align=center id="item4" style="position:absolute; left:250px; top:121px; width:99px; height:19px; z-index:5;filter:alpha(opacity=0)"<BR>class=none onmouseover="this.className='over';menuin()"<BR>onmouseout="this.className='none';menuout()">菜单项四</div> <div align=center id="item5" style="position:absolute; left:50px; top:143px; width:99px; height:19px; z-index:6; filter:alpha(opacity=0)"<BR>class=none onmouseover="this.className='over';menuin()"<BR>onmouseout="this.className='none';menuout()">菜单项五</div><BR><BR></div><BR><script language="vbs"><BR>dim down,divleft,divtop,timelinestart,timelinestop,tidone,tidtwo,tidtree<BR>down=false<BR>timelinestart=0<BR>timelinestop=0<BR>sub document_onmousemove<BR>if down then<BR>plane.style.left=window.event.clientx-divleft<BR>plane.style.top=window.event.clienty-divtop<BR>end if<BR>lt.value=divleft<BR>tp.value=divtop<BR>tx.value=window.event.clientx<BR>ty.value=window.event.clienty<BR>end sub<BR>sub document_ondargstart<BR>window.event.returnvalue=false<BR>end sub<BR>function menuin()<BR>cleartimeout(tidtree)<BR>end function<BR>function menuout()<BR>tidtree=settimeout("outit()",200)<BR>end function<BR>function init()<BR>if timelinestart<>5 then<BR>cleartimeout(tidtwo)<BR>item1.style.pixelLeft=item1.style.pixelLeft+20<BR>item1.filters.alpha.opacity=item1.filters.alpha.opacity+20<BR>item2.style.pixelLeft=item2.style.pixelLeft-20<BR>item2.filters.alpha.opacity=item2.filters.alpha.opacity+20<BR>item3.style.pixelLeft=item3.style.pixelLeft+20<BR>item3.filters.alpha.opacity=item3.filters.alpha.opacity+20<BR>item4.style.pixelLeft=item4.style.pixelLeft-20<BR>item4.filters.alpha.opacity=item4.filters.alpha.opacity+20<BR>item5.style.pixelLeft=item5.style.pixelLeft+20<BR>item5.filters.alpha.opacity=item5.filters.alpha.opacity+20<BR>timelinestart=timelinestart+1<BR>else<BR>cleartimeout(tidone)<BR>end if<BR>tidone=settimeout("init()",1)<BR>end function<BR>function outit()<BR>if timelinestart<>0 then<BR>cleartimeout(tidone)<BR>item1.style.pixelLeft=item1.style.pixelLeft-20<BR>item1.filters.alpha.opacity=item1.filters.alpha.opacity-20<BR>item2.style.pixelLeft=item2.style.pixelLeft+20<BR>item2.filters.alpha.opacity=item2.filters.alpha.opacity-20<BR>item3.style.pixelLeft=item3.style.pixelLeft-20<BR>item3.filters.alpha.opacity=item3.filters.alpha.opacity-20<BR>item4.style.pixelLeft=item4.style.pixelLeft+20<BR>item4.filters.alpha.opacity=item4.filters.alpha.opacity-20<BR>item5.style.pixelLeft=item5.style.pixelLeft-20<BR>item5.filters.alpha.opacity=item5.filters.alpha.opacity-20<BR>timelinestart=timelinestart-1<BR>else<BR>cleartimeout(tidtwo)<BR>end if<BR>tidtwo=settimeout("outit()",1)<BR>end function<BR></script><BR>divleft:<input id=lt> divtop:<input id=tp><br><BR>clientx:<input id=tx> clienty:<input id=ty><BR></body><BR></html></SPAN> <BR> |
|