https://www.javascriptcn.com/post/63072
暂时没找到相关文档!
scroll家族
1.网页正文全文宽:document.body.scrollWidth
2.网页正文全文高:document.body.scrollHeight
3.网页被卷去的高:document.body.scrollTop
(用的最多!)
4.网页被卷去的左:document.body.scrollLeft
案例:事件相应细节
<body>
<div id="btn" style="width: 100px;height: 100px;background: #449fdb">点我</div>
<div id="box"></div>
<script>
window.onload = function (ev) {
var btn = document.getElementById('btn');
var box = document.getElementById('box');
btn.addEventListener('mouseover', test);
btn.addEventListener('mouseout', function (ev1) {
btn.removeEventListener('mousedown', test);
})
};
function test(ev1) {
var e = ev1||window.event;
box.style.width = e.clientX + 'px';
box.style.height = e.clientY + 'px';
box.style.background = 'red';
}
</script>
</body>
removeEventListener
不懂???