Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1.  
  2. Jquery code :
  3.  
  4. <head>
  5. <script>
  6. $(document).ready(function(){
  7. $("#cpu li:lt(2)").css("background","url('images/image.png') no-repeat top center");
  8.  
  9. $( "#slider" ).slider({
  10. value: 1,
  11. min: 1,
  12. max: 4,
  13. step: 1,
  14. slide: function(event, ui) {
  15. slide_changement(ui.value);
  16. }
  17. });
  18.  
  19. function slide_changement (value){
  20. var index = value*2;
  21. $("#cpu li:lt("+index+")").css("background", "url('images/image.png') no-repeat top center");
  22. index--;
  23. }
  24. });
  25.  
  26. </script>
  27. </head>
  28.  
  29. <body>
  30.  
  31. <div id="cpu">
  32. <ul>
  33.  
  34.  
  35.  
  36. < -- I want that displays the tag <li> defined above with an image as background -->
  37.  
  38.  
  39.  
  40. </ul>
  41.  
  42. </div>
  43. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement