/ Published in: jQuery
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#step li").each(function (i) { i = i+1; $(this).addClass("item" i); }); }); </script> <style> #step .item1 { background: url(step1.png) no-repeat; } #step .item2 { background: url(step2.png) no-repeat; } #step .item3 { background: url(step3.png) no-repeat; } <body> <ol id="step"> <li></li> <li></li> <li></li> </ol> </body> </style>
URL: http://www.webdesignerwall.com/tutorials/jquery-sequential-list/