Created
January 17, 2013 03:37
-
-
Save Barneybook/4553394 to your computer and use it in GitHub Desktop.
〃☆語法 鎖右鍵的語法〃
http://blog.yam.com/rk182515859/article/19395486
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
按右鍵沒反應 | |
滑鼠鎖右鍵語法(1)↓ | |
<body oncontextmenu="window.event.returnValue=false"> | |
按右鍵反白文字沒反應 | |
滑鼠鎖右鍵語法(2)↓ | |
<body ONDRAGSTART="window.event.returnValue=false" ONCONTEXTMENU="window.event.returnValue=false" onSelectStart="event.returnValue=false"> | |
這個效果相當不錯,會將偷窺者丟到別搭網頁企... | |
轉址滑鼠所右鍵語法(1)↓ | |
<script language=JavaScript> | |
<!-- | |
if (navigator.appName.indexOf("Internet Explorer") != -1) | |
document.onmousedown = noSourceExplorer; | |
function noSourceExplorer() | |
{ | |
if (event.button == 2 | event.button == 3) | |
{ | |
alert("您已經按了右鍵,n疑似想偷看本站原始碼,n您將要受到懲罰,n就把您丟回首頁!"); | |
location.replace("網址"); | |
} | |
} | |
--> | |
</script> | |
一樣會丟到網站,但沒有對話方塊... | |
轉址滑鼠所右鍵語法(2)↓ | |
<script language="JavaScript"> | |
<!-- | |
if (navigator.appName.indexOf("Internet Explorer") != -1) | |
document.onmousedown = noSourceExplorer; | |
function noSourceExplorer() | |
{ | |
if (event.button == 2 | event.button == 3) | |
{ | |
window.open("http://black.demons.to/teach/") | |
} | |
} | |
--> | |
</script> | |
想處罰一下習慣偷窺的人嗎?使用此特效,可讓偷窺者深中對話視窗所苦。但是本站不是整人網站,所以語法只提供兩次對話。假如您時間夠多,心腸夠狠,可無限增加對話數量...... | |
鎖右鍵語法↓ | |
<script language="JavaScript"> | |
<!-- | |
function right(e) { | |
if (navigator.appName =='Netscape'&& | |
(e.which ==3|| e.which ==2)) | |
return false; | |
else if (navigator.appName == 'Microsoft Internet Explorer' && | |
(event.button == 2|| event.button ==3)) { | |
alert("疑");alert("好像按到什麼東西囉?");alert("沒錯,就是按到右鍵了");alert("我偏偏就是不給你按!"); | |
return false; | |
} | |
return true; | |
} | |
document.onmousedown=right; | |
if (document.layers) window.captureEvents(Event.MOUSEDOWN); window.onmousedown=right; | |
--> | |
</script> | |
按右鍵會加入最愛 | |
右鍵加入最愛↓ | |
<script language=JavaScript> | |
<!-- | |
function click() { | |
if (event.button==2) { | |
window.external.addFavorite(網址/',名子') | |
} | |
} | |
document.onmousedown=click | |
--> | |
</script> | |
按右鍵會有連賊單子 | |
右鍵開啟連結選單↓ | |
<style> | |
<!-- | |
#ie5menu{ | |
position:absolute; | |
width:50pt; | |
border:1pt solid black;/*外框粗細色彩*/ | |
background-color:menu;/*背景顏色*/ | |
line-height:15pt; | |
cursor:default; | |
visibility:hidden; | |
} | |
.menuitems{ | |
padding-left:5pt;/*修改連結文字離選單左邊的距離*/ | |
padding-right:5pt;/*修改連結文字離選單右邊的距離*/ | |
} | |
--> | |
</style> | |
<script language="JavaScript"> | |
<!-- | |
var display_url=0 | |
function showmenuie5(){ | |
ie5menu.style.left=document.body.scrollLeft+event.clientX | |
ie5menu.style.top=document.body.scrollTop+event.clientY | |
ie5menu.style.visibility="visible" | |
return false | |
} | |
function hidemenuie5(){ | |
ie5menu.style.visibility="hidden" | |
} | |
function highlightie5(){ | |
if (event.srcElement.className=="menuitems"){ | |
event.srcElement.style.backgroundColor="highlight" | |
event.srcElement.style.color="white" | |
if (display_url==1) | |
window.status=event.srcElement.url | |
} | |
} | |
function lowlightie5(){ | |
if (event.srcElement.className=="menuitems"){ | |
event.srcElement.style.backgroundColor="" | |
event.srcElement.style.color="black" | |
window.status='' | |
} | |
} | |
function jumptoie5(){ | |
if (event.srcElement.className=="menuitems") | |
window.location=event.srcElement.url | |
} | |
--> | |
</script> | |
<!--在 style="width: 55pt; height: 75pt" 中修改選單的寬度及高度--> | |
<div id="ie5menu" onMouseOver="highlightie5()" onMouseOut="lowlightie5()" onClick="jumptoie5()" style="width: 55pt; height: 75pt"> | |
<div class="menuitems" url="連結網址">連結名稱</div> | |
<div class="menuitems" url="連結網址">連結名稱</div> | |
<div class="menuitems" url="連結網址">連結名稱</div> | |
<div class="menuitems" url="連結網址">連結名稱</div> | |
<div class="menuitems" url="連結網址">連結名稱</div> | |
<script language="JavaScript"> | |
<!-- | |
document.oncontextmenu=showmenuie5 | |
if (document.all&&window.print) | |
document.body.onclick=hidemenuie5 | |
--> | |
</script> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment