js判断页面是否有滚动条的方法
无功isscroll =功能(EL){
测试目标
var = { }:elems EL EL {体} document.documentelement,文档;
无功scrollx = false,scrolly = false;
对于(var i = 0;i < elems.length;i++){
var o = elems {我};
测试
VaR SL = o.scrollleft;
o.scrollleft = - 1(SL>0):1;
o.scrollleft!= SL(scrollx = scrollx | |真);
o.scrollleft = SL;
测试垂直
var st = o.scrolltop;
o.scrolltop = - 1(ST>0):1;
o.scrolltop!= ST(scrolly = scrolly | |真);
o.scrolltop = ST;
}
返回{
ScrollX:scrollx,
scrolly:scrolly
};
};
希望本文能对大家的javascript程序设计有所帮助。