Hi Tony,
Thanks. Im going to be away for the w/e so wont be able to look at it until Monday.
One more thought… Math.round may be the answer after all.
The current formula is supposed to take a pixel value, and return the page that contains that pixel. For that, Math.round would be wrong (if you were in the lower half of the page, it would give the /next/ page).
But in this case, if all the calculations are correct, the pixel should always be the /first/ pixel on the page. But Im guessing (from Kaleb's investigation) that something isnt quite adding up, and we're getting an off by 1 (or perhaps off by border, or margin, or padding width, or some such) error. So Math.round ought to give the correct result.
Somehow doesnt feel right, because its just hiding the fact that the calculation isnt quite correct… but I think it /should/ work, as long as the error is less than half a page :-\
For the cells with images case… if the rows aren't all exactly the same height (?), the scrolling rows feature just isnt going to work as it stands (it depends on being able to translate back and forth between pixel offsets and row numbers /without/ having looked at all the preceding rows). I think it may be possible to fix that, but would require changing the scrolling logic somewhat…
Mark