鼠标移动到div上时页面滚动无效,滚轮只用于该div,移出div时滚轮只用于body. div滚动 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用两个div就可以解决<div style="width:100%;"> <div style="width:2000px;"></div></div> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style type="text/css">div{ width:300px;}#test1{ height:300px; overflow:auto; background-color:#F00;}#test2{ height:400px; background-color:#0F0;}#test3{ height:500px; background-color:#00F;}#test{ height:500px; background-color:#00F;}</style></head><body><div id="test"></div><div id="test1"> <div id="test2"></div></div><div id="test3"></div><script type="text/javascript">document.getElementById('test1').onmouseover=function(){ document.documentElement&&(document.documentElement.style.overflow='hidden'); document.body.style.overflow='hidden';}document.getElementById('test1').onmouseout=function(){ document.body.style.overflow='auto'; document.documentElement&&(document.documentElement.style.overflow='auto');}</script></body></html> 新手学js遇到问题,请教一下! 请帮忙解释一下代码,我看不懂 ¥¥¥¥¥¥¥高手来吧,非常头疼的简单javascript错误¥¥¥¥¥¥¥¥ javascript拖动的问题 一个鼠标跟随的问题,请大虾子们指教! 很菜鸟的一个问题,,,大哥们看一下!!! 谁用Sublime text2 为什么每次按代码提示都会多一个 “<” 符号!!! 下面这个页面的程序作用是什么啊?急~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 下拉框选项问题,100分题 不用表格定位,怎样使文字在层的正中央显示? 怎么让浏览器真正意义上最大化 关于prototype的一点疑惑
<div style="width:100%;">
<div style="width:2000px;"></div>
</div>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
div{
width:300px;
}
#test1{
height:300px;
overflow:auto;
background-color:#F00;
}
#test2{
height:400px;
background-color:#0F0;
}
#test3{
height:500px;
background-color:#00F;
}
#test{
height:500px;
background-color:#00F;
}
</style>
</head><body>
<div id="test"></div>
<div id="test1">
<div id="test2"></div>
</div>
<div id="test3"></div>
<script type="text/javascript">
document.getElementById('test1').onmouseover=function(){
document.documentElement&&(document.documentElement.style.overflow='hidden');
document.body.style.overflow='hidden';
}
document.getElementById('test1').onmouseout=function(){
document.body.style.overflow='auto';
document.documentElement&&(document.documentElement.style.overflow='auto');
}
</script>
</body>
</html>