問題:圖片模塊中如何去掉右鍵功能?
解答:文章模塊中,有個標簽{$ArticleProtect}放在模板的<body>中<body {$ArticleProtect}>,起去掉右鍵的功能。但這個標簽在圖片模塊中無法解析。
在前臺瀏覽文章模塊時<body {$ArticleProtect}>被解析成了<body oncontextmenu='return false' ondragstart='return false' onselectstart ='return false' onselect='document.selection.empty()' oncopy='document.selection.empty()' onbeforecopy='return false' onmouseup='document.selection.empty()'>。
我們把{$ArticleProtect}解析成的代碼oncontextmenu='return false' ondragstart='return false' onselectstart ='return false' onselect='document.selection.empty()' oncopy='document.selection.empty()' onbeforecopy='return false' onmouseup='document.selection.empty()'拷貝到圖片模塊模板的<body>中,就可以起到去掉右鍵的功能。
如,圖片模塊內容頁的<body onmousemove='HideMenu()'>拷入后就變成了
<body onmousemove='HideMenu()' oncontextmenu='return false' ondragstart='return false' onselectstart ='return false' onselect='document.selection.empty()' oncopy='document.selection.empty()' onbeforecopy='return false' onmouseup='document.selection.empty()'>
新聞熱點
疑難解答
圖片精選