Scrolling an UL within a div to a LI from external click
Hi Folks,
I am new to jQuery and was hoping someone could help me out with this - I really don't know where to start.
What I have is an automatically generated UL like this where each <li> contains information about a various subject or topic:
-
<div id="container">
-
<ul id="menu-list">
-
<li class="item-1">contents...</li>
-
<li class="item-2">contents...</li>
-
<li class="item-3">contents...</li>
-
<li class="item-4">contents...</li>
-
etc......
-
</ul>
-
</div>
Elsewhere on the page are links which if someone clicks on them I want the relevant <li> containing the information to scroll to the top of the container div and present the user with the info.
It is also important that the <ul> remains scrollable within the container div so that the user can actually scroll and navigate the <ul> as a menu also.
I have the container div fixed width and height with overflow:scroll; and the <ul> scrolls real nice in the div BUT that's as far as I have got - getting more confused the more I look so any help would be really appreciated.
Thanks in advance folks..