|
藍森林 http://www.lslnet.com 2006年8月25日 8:28
請教如何在這樣的情況下禁用右鍵
onClick="window.open(this.href,'', 'height=513,width=670,toolbar=no,location=no,status=no,menubar=no');return false"
用如上的代碼實現點擊出現新窗口
而窗口的鏈接則直接是圖片地址 並不是網頁
如果想在新開的圖片窗口內實現右鍵禁用
應該怎麼做呢? |
oWin=window.open(...)
oWin.document.body.oncontextmenu="return false;"
或者
oWin.document.oncontextmenu="return false;"
|
huhu那段代碼是在哪裡添加呢?
偶試了好像沒用啊
還是偶添加的部分不對? |
不好意思 我寫的有誤
[html]
<script>
oWin=window.open();
oWin.document.oncontextmenu=function(){return false;}
</script>
[/html]
或者
[html]
<script>
oWin=window.open();
oWin.document.oncontextmenu=Function("return false")
</script>
[/html] |

還要禁止工具條!
|
樓上滴哥哥,偶知道要素在HEAD中加入
<META HTTP-EQUIV="imagetoolbar" CONTENT="no">
可以消除工具條,但是這個直接打開圖片的話,應該加在什麼地方呢
或者用什麼別的辦法可以消除工具條?? |
我寫詳細一下:
<script LANGUAGE="JavaScript">
function openwin() {
openwin=window.open ("22.gif", "newwindow", "height=100, width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no")
openwin.document.oncontextmenu=function(){return false;}
}
</script>
這樣是不會有工具條的.
還有,樓上的,你說的那個只是取消緩存,而並沒有消除工具條的功能哦. |
xx.galleryimg="no" |
|