maccaj51
asked on
Jquery scroll maximum
I have simple scroller that auto slides and moves on click....
But how do i either make it continuous or stop when it gets to the last item...?
<div id="scroller-container">
<ul id="scroller">
<li>Test1</li>
<li>Test2</li>
</ul>
</div>
But how do i either make it continuous or stop when it gets to the last item...?
<div id="scroller-container">
<ul id="scroller">
<li>Test1</li>
<li>Test2</li>
</ul>
</div>
ASKER
would this also work if i have more than two items? e.g.
<div id="scroller-container">
<ul id="scroller">
<li>Test1</li>
<li>Test2</li>
<li>Test3</li>
<li>Test4</li>
</ul>
</div>
<div id="scroller-container">
<ul id="scroller">
<li>Test1</li>
<li>Test2</li>
<li>Test3</li>
<li>Test4</li>
</ul>
</div>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Here is my current code..
how would i use this...
$('li').last().
and say if last li is at a certain position then hide class=next
<div id="scroller-container">
<ul id="scroller">
<li>Test</li>
<li>Poo</li>
<li>Test</li>
<li>Poo</li>
</ul>
</div>
<a class="prev">Previous</a> <a class="next">Next</a>
?
how would i use this...
$('li').last().
and say if last li is at a certain position then hide class=next
<div id="scroller-container">
<ul id="scroller">
<li>Test</li>
<li>Poo</li>
<li>Test</li>
<li>Poo</li>
</ul>
</div>
<a class="prev">Previous</a> <a class="next">Next</a>
?
ASKER
sorted it eventually
http://api.jquery.com/last-child-selector/
then you can scroll that element into view using
http://stackoverflow.com/questions/68165/javascript-to-scroll-long-page-to-div/68671#68671