鼠标轮滚过快就执行了2次document.title +=ss;
如果点击滚动条手动拉动的话就正常
有什么办法解决吗?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title><style type="text/css">
*{ margin:0;padding:0; }
#wrap{ width:980px;position:relative;margin:0 auto; }
body{ height:1100px }
</style>
</head>
<body><script type="text/javascript">    function log(i){ return console.log(i); } 
    var $ = function(id){ return typeof id == "string" ? document.getElementById(id) : id };
window.onscroll = function(){
var tops =0;
                if(document.body.scrollTop){
                    tops = document.body.scrollTop;
                }
                else{
                    tops = document.documentElement.scrollTop;
                }

if(tops >= document.documentElement.scrollHeight - document.documentElement.clientHeight){
var ss="1";
document.title +=ss;
}
}
    
</script>
</body>
</html>