Reputation: 328
Sorry if this was posted before, I'm looking for a script that scrolls an ul list horizontally with controls, most examples get ruined because li itens should have the same fixed width while texts are in different lenghts.
<div id="slidelist">
<span class="nav-prev"><a href="#">«</a></span>
<div class="listarea">
<ul id="submen">
<li>Home</li>
....
</ul>
</div>
<span class="nav-next"><a href="#">»</a></span>
</div>
CSS:
#slidelist #submen ul {display:block; height:20px; position:absolute}
#slidelist #submen ul li {display:inline; border:none; margin-right:20px}
#slidelist .listarea {width:90%;float:left;}
#slidelist .nav-prev {float:left;width:20px;}
#slidelist .nav-next {float:right;width:20px;}
Clicking the prev an next scroll or slide the list inside the div.
Upvotes: 2
Views: 2662
Reputation: 57322
try something like
$(".nav-prev").click(function(){$(this).show('slide', { direction: 'left' }, 1000);})
$(".nav-next").click(function(){$(this).show('slide', { direction: 'left' }, 1000);})
Upvotes: 1