The scrollLeft property of a div seems to return different values in different browsers when the body direction is rtl.
An example can be seen here - http://jsfiddle
Although I was hoping to avoid that, I ended up using browser detection:
function GetScrollLeft(elem)
{
var scrollLeft = elem.scrollLeft();
if ($("body").css("direction").toLowerCase() == "rtl")
{
// Absolute value - gets IE and FF to return the same values
var scrollLeft = Math.abs(scrollLeft);
// Get Chrome and Safari to return the same value as well
if ($.browser.webkit)
{
scrollLeft = elem[0].scrollWidth - elem[0].clientWidth - scrollLeft;
}
}
return scrollLeft;
}
Browser incompatibilities. Try this