如何完全禁止滚动条


body的overflow设为hidden可以禁止滚动条 但是还是有方法拉下去的 选中文本往下拖就行了 如何完全禁止呢

css3 JavaScript

dongxingdvd 12 years ago
   
  <!-- 禁止选择文本: -->
  
<script type="text/javascript">
var omitformtags = ["input", "textarea", "select"] omitformtags = omitformtags.join("|") function disableselect(e) {
if (omitformtags.indexOf(e.target.tagName.toLowerCase()) == -1) return false
}
function reEnable() {
return true
}
if (typeof document.onselectstart != "undefined") document.onselectstart = new Function("return false")
else {
document.onmousedown = disableselect document.onmouseup = reEnable
}
</script>

库尔提拉斯 answered 12 years ago

Your Answer