<html>
<head>
<title>测试滚动条事件</title>
<style type="text/css">
#divone{
float:left;
width:500px;
height:500px;
border:1px solid red;
overflow:auto;
}
#divtwo{
float:left;
width:500px;
height:500px;
border:1px solid red;
margin-left:100px;
overflow:hidden;
}
</style>
</head>
<body onkeydown="self.event.returnValue=false"
oncontextmenu="self.event.returnValue=false" onselect="return false"
onselectstart="self.event.returnValue=false" ondrag="return false">
<div id="divone">
<div style="height:1200px;"></div>
</div>
<div id="divtwo">
<div style="height:1000px;">
adadadadadadadadaadadadadadadadadaadadadadadada
dadaadadadadadadadadaadadadadadadadada
</div>
</div>
<div id="divthree"></div>
<script type="text/javascript" src="jquery-1.5.1.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#divone').scroll(function(){
$('#divthree').text($(this).scrollTop());
$('#divtwo').scrollTop($(this).scrollTop());
});
});
</script>
</body>
</html>
两个滚动条并发,body无选中、刷新、右单击
最新推荐文章于 2021-07-17 09:08:42 发布