I’m writing a javascript based photo gallery with a horizontally scrollable thumbnail bar.
>> My current work-in-progress is here <<
I would like the thumbnail bar to stop scrolling when it gets to the last thumbnail. To do this I need to find the total width of the contents of the div – preferably without adding up the widths of all the thumbnail images and margins.
I’ve put an alert in my window.onload function so I can test the various element dimension functions in different browsers. currently it’s showing the value of scrollWidth, which is reported as 1540px by IE and 920px by FireFox, Safari, Opera, etc.
The value 1540 is the correct one for my purposes, Can anyone tell me how to obtain this value in FireFox, etc.
Maybe you’re just referencing the wrong element.
is giving me 1540 on that page in both IE6 and firefox 2. Is that what you’re looking for?
BTW in IE6 the thumbnails extend way past the right scroller.