I am use the following javascript code to detect the scroll movement in various browsers. Mostly IE and FF since those are the only two I got.
I was wondering if this code is compatible in other browsers and for most version of the two I have already mentioned.
Code:
function getScrollMovement(){
if (typeof(pageXOffset) != "undefined")
{
currentX=window.pageXOffset;
currentY=window.pageYOffset;
}
else if (document.compatMode == "CSS1Compat" )
{
currentX=document.documentElement.scrollLeft
currentY=document.documentElement.scrollTop
}
else
{
currentX=document.body.scrollLeft
currentY=document.body.scrollTop
}
}
I was wondering if this code is compatible in other browsers and for most version of the two I have already mentioned.



