Skip to content Skip to sidebar Skip to footer

Why Scrollwidth Doesn't Work In This Case In Firefox?

I'm trying to make a simple marquee in Javascript, and need to get the full content width of innerDIV in the following:
var scrollWidth = $(ele).css("overflow", "hidden")[0].scrollWidth;
alert('clientWidt h = ' + ele.clientWidth + ',  scrollWidth = ' + scrollWidth  );
$(ele).css("overflow", "visible");

Best of luck,

Andrei

Solution 2:

This seems to do the trick:

docWidth = Math.max(
        Math.max(frameDoc.body.scrollWidth, frameDoc.documentElement.scrollWidth),
        Math.max(frameDoc.body.offsetWidth, frameDoc.documentElement.offsetWidth)                               
);

Post a Comment for "Why Scrollwidth Doesn't Work In This Case In Firefox?"