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?