数码资讯
js网页大小判断示例方法
复制代码代码如下所示: 功能reachbottom(){ VaR scrollTop = 0; var自己= 0; 无功scrollheight = 0; 如果(document.documentelement文档。文档元素}。scrollTop){ scrollTop = document.doc
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
复制代码代码如下所示:
功能reachbottom(){
VaR scrollTop = 0;
var自己= 0;
无功scrollheight = 0;
如果(document.documentelement文档。文档元素}。scrollTop){
scrollTop = document.documentelement.scrolltop;
否则如果(文档体){ }
scrollTop = document.body.scrolltop;
}
如果(document.body.clientheight文档。文档元素}。自己){
自己=(document.body.clientheight <文档。文档元素}。自己document.body.clientheight:document.documentelement.clientheight);
{人}
自己=(document.body.clientheight >文档。文档元素}。自己document.body.clientheight:document.documentelement.clientheight);
}
scrollheight = math.max(document.body.scrollheight,文档。文档元素}。scrollheight);
如果(scrollTop +自己= = scrollheight){
返回true;
{人}
返回false;
}
}
功能reachbottom(){
VaR scrollTop = 0;
var自己= 0;
无功scrollheight = 0;
如果(document.documentelement文档。文档元素}。scrollTop){
scrollTop = document.documentelement.scrolltop;
否则如果(文档体){ }
scrollTop = document.body.scrolltop;
}
如果(document.body.clientheight文档。文档元素}。自己){
自己=(document.body.clientheight <文档。文档元素}。自己document.body.clientheight:document.documentelement.clientheight);
{人}
自己=(document.body.clientheight >文档。文档元素}。自己document.body.clientheight:document.documentelement.clientheight);
}
scrollheight = math.max(document.body.scrollheight,文档。文档元素}。scrollheight);
如果(scrollTop +自己= = scrollheight){
返回true;
{人}
返回false;
}
}
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。