Advertisement
LegoDrifter

Untitled

Dec 2nd, 2020
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. $(document).ready(function () {
  2. var index = 0
  3. $("div").not("#0, div:last-of-type").hide()
  4. $("#prev").click(function () {
  5. if(index>0){
  6. index--
  7. $("div").show().not("#"+index+", div:last-of-type").hide()
  8. }
  9. })
  10. $("#next").click(function () {
  11. if(index<3){
  12. index++
  13. $("div").hide()
  14. $("#"+index+", div:last-of-type").show()
  15. }
  16. })
  17. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement