Why is scrollTop always 0 under chrome?

var oSpan = document.getElementById("span");
        console.log(document.compatMode);//chromeCSS1Compat
        EventUtil.addHandler(window,"scroll",function(event){//
            if (document.compatMode === "CSS1Compat")
            {
                oSpan.innerHTML= document.documentElement.scrollTop;//0
            }else {
                oSpan.innerHTML= document.body.scrollTop;
            }
             
        });

is normal in IE but always 0 in chrome

var oSpan = document.getElementById("span");
        EventUtil.addHandler(window,"scroll",function(event){//
                oSpan.innerHTML= document.documentElement.scrollTop || document.body.scrollTop;//
        });

in this case, both IE and Chrome are normal!
Please give a correct solution?

Jun.23,2021

Local test, your code is correct, check to see if your environment and page are rendered in standard mode.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36671-e55e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36671-e55e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?