var
isScroll =
function
(el) {
var
elems = el ? [el] : [document.documentElement, document.body];
var
scrollX =
false
, scrollY =
false
;
for
(
var
i = 0; i < elems.length; i++) {
var
o = elems[i];
var
sl = o.scrollLeft;
o.scrollLeft += (sl > 0) ? -1 : 1;
o.scrollLeft !== sl && (scrollX = scrollX ||
true
);
o.scrollLeft = sl;
var
st = o.scrollTop;
o.scrollTop += (st > 0) ? -1 : 1;
o.scrollTop !== st && (scrollY = scrollY ||
true
);
o.scrollTop = st;
}
return
{
scrollX: scrollX,
scrollY: scrollY
};
};