Вопрос по javascript, android – Альтернативы для window.scrollMaxY?

9

Error: User Rate Limit Exceededwindow.pageYOffsetError: User Rate Limit Exceededwindow.scrollMaxYError: User Rate Limit Exceededwindow.scrollMaxYError: User Rate Limit Exceeded

Ваш Ответ

4   ответа
14

window.scrollMaxY:

document.documentElement.scrollHeight - document.documentElement.clientHeight

window.scrollMaxY

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceededwindow.scrollYError: User Rate Limit Exceededwindow.scrollYError: User Rate Limit ExceededscrollHeightError: User Rate Limit ExceededclientHeightError: User Rate Limit ExceededMath.round()Error: User Rate Limit Exceeded
3

function getScrollMaxY(){ 

var innerh;

if (window.innerHeight){
     innerh = window.innerHeight;
}else{
     innerh = document.body.clientHeight;
}

if (window.innerHeight && window.scrollMaxY){
    // Firefox 
    yWithScroll = window.innerHeight + window.scrollMaxY; 
} else if (document.body.scrollHeight > document.body.offsetHeight){ 
    // all but Explorer Mac 
    yWithScroll = document.body.scrollHeight; 
} else { 
    // works in Explorer 6 Strict, Mozilla (not FF) and Safari 
    yWithScroll = document.body.offsetHeight; 
} 
return yWithScroll-innerh; 
}
0

 x = document.body.clientHeight;
 console.log(x ,"Cline HEight");     

 xx = window.innerHeight;
 console.log(xx, "Inner Height");

 xxx = document.body.scrollHeight
 console.log(xxx, "scrollHeight");

 xxxx = window.scrollMaxY; 
 console.log(xxxx, "scrollMaxY for IE");


 xxxxx = document.body.offsetHeight;
 console.log(xxxxx, "offsetHeight");

 xxxxxx= document.body.scrollTop;
 console.log(xxxxxx, "scrollTop");strong text
2

document.body.scrollHeight

document.body.scrollHeight = window.pageYOffset + screen height in pixels

Похожие вопросы