📜  body.scrollTop - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:08.083000             🧑  作者: Mango

代码示例2
body {
        height: 4000px;
        width: 4000px;
}
      
.main{
        position: fixed;
}
    
var myMain = document.getElementById('main');
var number = 0;

myMain.onclick = function () {
    
       'use strict;
    
        number += 100;
        window.scrollTo(0, number);
    
        console.log(window.scrollY);
    };