Marv -

I could be mistaken here, but I think your solution's really good so
long as the entire sub-element (the DIV or image or whatever) is
visible. But if there's a scrollbar on that element, I think your code
will only tell you where you clicked in terms of the position on the
page (relative to the 0,0 of the page, or to the 0,0 of the visible
(non-scroll-bar) div), rather than the distance *within* the scrolled
div, relative to the 0,0 of the scrollbar-having div (which could be
off-screen, since you've scrolled). If that makes sense. It's tricky
to describe.

Basically, you have a 200px-tall div, and it's inside a container
that's only 50px tall. You've scrolled down by 40px, and you click a
spot that's 20px down within the element. The value you want back is
60 (40 hidden px + 20 visible px), but I think the code you gave would
only give you a value of 20. Whereas the code I listed at 4/22 8:09
should give you the value of 60.

Reply via email to