推荐:极酷右键菜单_Javascript教程-查字典教程网
推荐:极酷右键菜单
推荐:极酷右键菜单
发布时间:2016-12-30 来源:查字典编辑
摘要:复制代码代码如下:点击右键看看!body,td,a{font-size:9pt;color:black}.none{border:black...

复制代码 代码如下:<>

点击右键看看!

<style>

body,td,a{font-size:9pt;color:black}

.none{border:black1pxsolid;background:D9D9D9;padding-top:2}

.over{border:black1pxsolid;background:707888;color:white;padding-top:2}

</style>

<bodyoncontextmenu="returnfalse">

<divnone';"ID=plane

onmousedown="down=true;divleft=event.clientX-parseInt(plane.style.left);

divtop=event.clientY-parseInt(plane.style.top)"onmouseup="down=false">

<divalign=centerclass="none"

onmouseover="menuin();init()">右键菜单</div>

<divalign=centerid="item1"onmouseover="this.className='over';menuin()"

onmouseout="this.className='none';"class="none"

><ahref=http://www.pcedu.com.cn>网络学院</a></div>

<divalign=centerid="item2"

class=noneonmouseover="this.className='over';menuin()"

onmouseout="this.className='none';"><ahref=#>菜单项二</a></div>

<divalign=centerid="item3"

class=noneonmouseover="this.className='over';menuin()"

onmouseout="this.className='none';">菜单项三</div>

<divalign=centerid="item4"

class=noneonmouseover="this.className='over';menuin()"

onmouseout="this.className='none';">菜单项四</div><divalign=centerid="item5"

class=noneonmouseover="this.className='over';menuin()"

onmouseout="this.className='none';">菜单项五</div>

</div>

<scriptlanguage="vbs">

dimdown,divleft,divtop,timelinestart,timelinestop,tidone,tidtwo,tidtree

down=false

timelinestart=0

timelinestop=0

subdocument_onmousedown

ifwindow.event.button=2then

plane.style.display=""

plane.style.left=window.event.clientx-153

plane.style.top=window.event.clienty-35

endif

endsub

subdocument_onmousemove

ifdownthen

plane.style.left=window.event.clientx-divleft

plane.style.top=window.event.clienty-divtop

endif

endsub

subdocument_ondargstart

window.event.returnvalue=false

endsub

functionmenuin()

cleartimeout(tidtree)

endfunction

subdocument_onclick

tidtree=settimeout("outit()",200)

endsub

functioninit()

iftimelinestart<>5then

cleartimeout(tidtwo)

item1.style.pixelLeft=item1.style.pixelLeft+20

item1.filters.alpha.opacity=item1.filters.alpha.opacity+20

item2.style.pixelLeft=item2.style.pixelLeft-20

item2.filters.alpha.opacity=item2.filters.alpha.opacity+20

item3.style.pixelLeft=item3.style.pixelLeft+20

item3.filters.alpha.opacity=item3.filters.alpha.opacity+20

item4.style.pixelLeft=item4.style.pixelLeft-20

item4.filters.alpha.opacity=item4.filters.alpha.opacity+20

item5.style.pixelLeft=item5.style.pixelLeft+20

item5.filters.alpha.opacity=item5.filters.alpha.opacity+20

timelinestart=timelinestart+1

else

cleartimeout(tidone)

endif

tidone=settimeout("init()",1)

endfunction

functionoutit()

iftimelinestart<>0then

cleartimeout(tidone)

item1.style.pixelLeft=item1.style.pixelLeft-20

item1.filters.alpha.opacity=item1.filters.alpha.opacity-20

item2.style.pixelLeft=item2.style.pixelLeft+20

item2.filters.alpha.opacity=item2.filters.alpha.opacity-20

item3.style.pixelLeft=item3.style.pixelLeft-20

item3.filters.alpha.opacity=item3.filters.alpha.opacity-20

item4.style.pixelLeft=item4.style.pixelLeft+20

item4.filters.alpha.opacity=item4.filters.alpha.opacity-20

item5.style.pixelLeft=item5.style.pixelLeft-20

item5.filters.alpha.opacity=item5.filters.alpha.opacity-20

timelinestart=timelinestart-1

else

cleartimeout(tidtwo)

plane.style.display="none"

exitfunction

endif

tidtwo=settimeout("outit()",1)

endfunction

</script>

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新Javascript教程学习
    热门Javascript教程学习
    编程开发子分类