鼠标右键显隐效果

2016-01-29 11:50 7 1 收藏

鼠标右键显隐效果,鼠标右键显隐效果

【 tulaoshi.com - Javascript 】

把如下代码加入<body区域中
<style
body,td,a {font-size:9pt;color:black}
.none{border:black 1px solid;background:D9D9D9;padding-top:2}
.over {border:black 1px solid;background:707888;color:white;padding-top:2}
</style
<body oncontextmenu="return false"
<div style="position:absolute; left: 100; top: 100;cursor: hand;display='none';" ID=plane onmousedown="down=true;divleft=event.clientX-parseInt(plane.style.left);divtop=event.clientY-parseInt(plane.style.top)" onmouseup="down=false"
<div align=center style="position:absolute; left:150px; top:33px; width:100px; height:19px; z-index:1;color:white;background:707888;cursor:default;" class="none" onmouseover="menuin();init()"右键菜单</div
<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()"
onmouseout="this.className='none';" class="none"
菜单项一</div
<div align=center id="item2" style="position:absolute; left:250px; top:77px; width:99px; height:19px; z-index:3;filter:alpha(opacity=0)"
class=none onmouseover="this.className='over';menuin()"
onmouseout="this.className='none';"菜单项二</div
<div align=center id="item3" style="position:absolute; left:50px; top:99px; width:99px; height:19px; z-index:4; filter:alpha(opacity=0)"
class=none onmouseover="this.className='over';menuin()"
onmouseout="this.className='none';"菜单项三</div
<div align=center id="item4" style="position:absolute; left:250px; top:121px; width:99px; height:19px; z-index:5;filter:alpha(opacity=0)"
class=none onmouseover="this.className='over';menuin()"
onmouseout="this.className='none';"菜单项四</div <div align=center id="item5" style="position:absolute; left:50px; top:143px; width:99px; height:19px; z-index:6; filter:alpha(opacity=0)"
class=none onmouseover="this.className='over';menuin()"
onmouseout="this.className='none';"菜单项五</div

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/javascript/)

</div
<script language="vbs"
dim down,divleft,divtop,timelinestart,timelinestop,tidone,tidtwo,tidtree
down=false
timelinestart=0
timelinestop=0
sub document_onmousedown
if window.event.button=2 then
plane.style.display=""
plane.style.left=window.event.clientx-153
plane.style.top=window.event.clienty-35
end if
end sub
sub document_onmousemove
if down then
plane.style.left=window.event.clientx-divleft
plane.style.top=window.event.clienty-divtop
end if

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/javascript/)

end sub
sub document_ondargstart
window.event.returnvalue=false
end sub
function menuin()
cleartimeout(tidtree)
end function
sub document_onclick
tidtree=settimeout("outit()",200)
end sub
function init()
if timelinestart<5 then
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)
end if
tidone=settimeout("init()",1)
end function
function outit()
if timelinestart<0 then
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=item

来源:https://www.tulaoshi.com/n/20160129/1483555.html

延伸阅读
标签: 浏览器
Firefox如何解除网页对鼠标右键的限制   打开Firefox,点击选项 - 内容 - 启用javascript - 高级 - 禁用或者替换上下文菜单取消该项前的勾选就可以解除网页对鼠标右键的限制了。
第一步:在电脑桌面点击开始,打开程序/附件/记事本。 第二步:在记事本里粘贴Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOTDirectoryBackgroundshellexContextMenuHandlersNew] @="{D969A300-E7FF-11d0-A93B-00A0C90F2719}"。 第三步:在左上角点击...
标签: Web开发
遇到网页上有精美图片或者精彩文字想保存时,通常大家都是选中目标后按鼠标右键,在弹出菜单中选择“图片另存为”或“复制”来达到我们的目的。但是,目前有许多网页都屏蔽了鼠标右键,致使我们一按鼠标右键就会弹出个窗口,上面写着XXX版权所有、禁止使用右键之类的话,对此大家都已经习以为常了。 其实,这是由于网页文件中被加入了如下...
标签: windows10
Win10系统鼠标右键反应慢怎么办   鼠标是操作电脑的重要外接设备,在使用中难免会遇到鼠标问题,比如鼠标无法识别、单击变双击、卡顿不灵敏等等故障,豆豆系统图老师小编之前也对这些故障进行整理过,最近有用户在全新的win10系统中遇到鼠标右键时不灵敏反应时间长的问题,这很是影响到电脑工作效率,那么在win10下出现的鼠标右键问题...
标签: PS PS教程
本文由 中国      myjunbb    原创,转载注明出处 1.打开要处理的文件,新建一个层(快捷键Ctrl+Shift+N),然后用矩形选框工具在画布上画出一个圆~~随便填充一种颜色 screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口查看全图\nCTRL+鼠标滚轮放大或缩小';...