Commit 289a7dbd authored by Julien Cigar's avatar Julien Cigar
Browse files

added Yeti.DOM.getScrollXY

parent e471750f
......@@ -36,7 +36,7 @@
Yeti.Str.trim = function(src) {
return src.trim ?
src.trim() :
src.replace(/^\s+|\s+$/g,'');
src.replace(/^\s+|\s+$/g, '');
}
/* Yeti.Str.reverse
......@@ -464,6 +464,25 @@
} : undefined
}
/* Yeti.DOM.getScrollXY
* Returns the number of pixels that the document has already been
* scrolled.
*/
Yeti.DOM.getScrollXY = function() {
return typeof(window.pageYOffset) == 'number' ? {
Y : window.pageYOffset,
X : window.pageXOffset
} : document.body && document.body.scrollLeft ? {
Y : document.body.scrollTop,
X : document.body.scrollLeft
} document.documentElement &&
document.documentElement.scollLeft ? {
Y : document.documentElement.scrollTop,
X : document.documentElement.scrollLeft
} : { Y : 0, X : 0 }
}
/***********************************************************************
Tools
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment