Advertisement
metalni

pyramid[jquery]

Dec 4th, 2020 (edited)
1,567
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.70 KB | None | 0 0
  1. $(document).ready(function (){
  2.     var id = -1;
  3.     console.log(id)
  4.     $("#low-level").hide()
  5.  
  6.     $(".click").click(function (){
  7.         id = $(this).attr("title")
  8.         $("#high-level").hide()
  9.         $("#low-level").show()
  10.         $("#0, #1, #2, #3").hide()
  11.         $("#" + id).show()
  12.     })
  13.  
  14.     $("#top").click(function (){
  15.         $("#low-level").hide()
  16.         $("#high-level").show()
  17.     })
  18.  
  19.     $("#next").click(function (){
  20.         $("#" + id).hide()
  21.         id++
  22.         id = id === 4 ? 0 : id
  23.         $("#" + id).show()
  24.     })
  25.  
  26.     $("#prev").click(function (){
  27.         $("#" + id).hide()
  28.         id--
  29.         id = id < 0 ? 4 - 1 : id
  30.         $("#" + id).show()
  31.     })
  32.  
  33. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement