how to achieve a horizontal jQuery slider effect -


i have list of html <li> elements, want scroll horizontally jquery , have current date displaying bigger, text effects have no clue how go coding horizontal slider.

saying have far below or view jsfiddle

<div class="yearswrapper">     <ul class="yearslist">         <li><a href="">2003</a></li>         <li><a href="">2004</a></li>         <li><a href="">2005</a></li>         <li><a href="">2006</a></li>         <li><a href="">2007</a></li>         <li><a href="">2008</a></li>         <li><a href="">2009</a></li>         <li><a href="">2010</a></li>         <li><a href="">2011</a></li>         <li><a href="">2012</a></li>         <li><a href="">2013</a></li>     </ul>     <p id="left">slide left</p>     <p id="right">slide right</p> </div> 

css.css

.yearslist li {      display:inline; } 

check out jquery slider: http://jqueryui.com/slider/ ( make sure download jquery, jquery ui , ui css ).

once have working slider, there event called slide. each time user changes value of slider, checks against slide event. concept check against value of slide event , change css accordingly.

$( '#slider' ).slider({     value: 1, // start @ first li     step: 1,  // slider moves , down 1 check each year     max: 13,  // end @ year 2013     slide: function( event, ui ) {         //check against ui.value , change css         $( 'li' ).eq( ui.value ).css( 'font-weight', 'bold' );     } }) 

there more documentation on jquery slider here: http://api.jqueryui.com/slider/


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -