Jquery find first visible element after horizontal scroll
- by lolo flores
I’m new (only two weeks old) in Jquery, so please bear with me.
I know that a very similar question was asked some time ago
but I do not know how to adapt the answer to my problem.
I have a very wide multicolumn layout something like this:
| aaaa | bbbb | cccc | … |
| aaaa | b | cc | … |
| aaa | cccc | ddd | … |
The code looks like:
<div id="container">
<p>aaaaaaaaaaa</p>
<p>bbbbb</p>
<p>ccccccccccc</p>
<p>dddddddddd</p>
...
<p>xxxxxx</p>
</div>
There is no vertical scrolling and the container width
is set in such a way that only two columns are shown.
The user scrolls left or right to see the relevant text.
What I want is to get the position currently on display,
store it (maybe in a cookie) and retrieve it the next
time the user opens the page.
I think that I need a way of finding out what paragraph
is currently the left-top most, but other suggestions
are very welcome.
Any ideas?
btw: this is an internal project, so Mozilla only :-)
Thanks
Lolo