Jquery find first visible element after horizontal scroll

Posted by lolo flores on Stack Overflow See other posts from Stack Overflow or by lolo flores
Published on 2010-05-22T18:31:20Z Indexed on 2010/05/22 18:50 UTC
Read the original article Hit count: 196

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery