日期:2014-05-16  浏览次数:20388 次

为什么onscroll事件在firfox下黑屏的?
<!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>
<script type="text/javascript">
window.onscroll=function(){
  alert(document.body.scrollTop || document.documentElement.scrollTop);//firfox黑屏!
 }
</script>
</head>

在chrome可以正常显示数据,但在firfox下就一卡一卡的黑屏,求高手解答下



------解决方案--------------------
你这样会一直弹出信息的!当加载到这里就会卡住的!!剩下的就加载不了了
------解决方案--------------------
onscroll:不是说从你滚动开始到滚动结束才执行一次,而是从开始到结束中间的位置都会被触发,因此,你滚动得越大,需要弹出来的次数越多。就变成你说的一卡一卡了