网页中屏蔽右键,不允许选择文本.兼容IE,Firefox
2009-06-16 15:33
399 查看
<style>
body {
-moz-user-select : none;
}
</style>
<script>
document.oncontextmenu=function(e){return false;}
window.onload = function(){
document.body.onmouseup = function (){document.selection.empty();};
document.body.oncontextmenu = function () {return false;};
document.body.onselectstart = function () {return false;};
document.body.onselect = function () {document.selection.empty()};
}
</script>
body {
-moz-user-select : none;
}
</style>
<script>
document.oncontextmenu=function(e){return false;}
window.onload = function(){
document.body.onmouseup = function (){document.selection.empty();};
document.body.oncontextmenu = function () {return false;};
document.body.onselectstart = function () {return false;};
document.body.onselect = function () {document.selection.empty()};
}
</script>
相关文章推荐
- IE,FireFox中屏蔽右键菜单和选择功能
- 屏蔽网页右键,兼容IE6,IE7,IE8,FireFox,谷歌Chrome浏览器
- js屏蔽右键菜单,鼠标选中,兼容IE,FireFox
- javascript 实现禁止右键,复制,选取文本 (兼容firefox,IE,chrome等主流浏览器)
- 网页快捷键-上下翻页(兼容firefox和ie)
- js实现自定义右键菜单--兼容IE、Firefox、Chrome
- 屏蔽浏览器刷新 兼容firefox 和 ie
- javascript 右键菜单 支持多级菜单 支持不同节点展示不同菜单 兼容firefox和IE
- JS日历控件 (兼容IE firefox) 可选择时间
- js实现鼠标右键自定义菜单(弹出层),并与树形菜单(TreeView)、iframe合用(兼容IE、Firefox、Chrome)
- 网页设计精华点滴,如屏蔽【复制、选择、右键菜单】等
- CSS禁止选择文本功能(兼容IE,火狐等浏览器)
- 让你网页同时兼容FireFox和IE
- CSS禁止选择文本功能(兼容IE,火狐等浏览器)
- 在浏览器屏蔽右键、文本选择、文本拖动、复制等操作
- 转一个右键菜单,支持不同对象不同菜单,兼容IE、Firefox
- 屏蔽刷新和Ctrl键Shift键和Alt键,兼容IE,Firefox,Chrome,兼容Firefox
- JS日期选择器(兼容IE,Firefox,Opera等主流浏览器)
- js屏蔽浏览器(IE和FireFox)的刷新和右键等功能
- JS日历控件 (兼容IE firefox) 可选择时间