Advertisement
Guest User

fixed slider

a guest
Feb 8th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // old function
  2. $('.slideshow-timeline a').click(function() {
  3.     var target_id = $(this).attr('href');
  4.     removeClasses();
  5.     $($(".tour-panel")[current]).addClass("fadeOutRight");
  6.     setTimeout(function() {
  7.         $(target_id).addClass("active-tour fadeInLeft");
  8.     }, 50);
  9.     setTimeout(function() {
  10.         $($(".tour-panel")[current]).removeClass("fadeOutRight");
  11.     }, 750);
  12.     current = target_id.split('-')[1] || 0;
  13. });
  14.  
  15. // new function
  16.   $('.slideshow-timeline a').click(function() {
  17.     var target_id = $(this).attr('href');
  18.     removeClasses();
  19.     $($(".tour-panel")[current]).addClass("fadeOutLeft");
  20.     current = parseInt(target_id.split('-')[1]) || 0;           // change here
  21.     setTimeout(function() {
  22.       $($(".tour-panel")[current]).addClass("active-tour fadeInRight");
  23.     }, 50);
  24.     // ################################
  25.     // this part wasn't essentially necessary, but you can uncomment it if you need/want it
  26.     /*
  27.     setTimeout(function() {
  28.       $($(".tour-panel")[previousIndex()]).removeClass("active-tour fadeOutLeft");
  29.     }, 750);
  30.     */
  31.   });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement