Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Jquery code :
- <head>
- <script>
- $(document).ready(function(){
- $("#cpu li:lt(2)").css("background","url('images/image.png') no-repeat top center");
- $( "#slider" ).slider({
- value: 1,
- min: 1,
- max: 4,
- step: 1,
- slide: function(event, ui) {
- slide_changement(ui.value);
- }
- });
- function slide_changement (value){
- var index = value*2;
- $("#cpu li:lt("+index+")").css("background", "url('images/image.png') no-repeat top center");
- index--;
- }
- });
- </script>
- </head>
- <body>
- <div id="cpu">
- <ul>
- < -- I want that displays the tag <li> defined above with an image as background -->
- </ul>
- </div>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement