首页 > CMS > 动易CMS > 正文

图片模块中如何去掉右键功能?

2024-09-10 21:54:34
字体:
来源:转载
供稿:网友

问题:图片模块中如何去掉右键功能?

解答:文章模块中,有个标签{$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()'>

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选