Guest User

HELP

a guest
Jul 4th, 2016
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var main = function () {
  2.   $('#dropdown-toggle').click(function() {
  3.     $('#dropdown-menu').toggle();
  4.   });
  5.     $(document).click(function(event) {
  6.   if (!$(event.target).closest('#dropdown-toggle').length) {
  7.     $('#dropdown-menu').hide();
  8.   }
  9.   });
  10.     $('#nav-toggle').click(function(event) {
  11.         $('#nav-collapse ul').toggle();
  12.     });
  13.     $('.arrow-next').click(function() {
  14.         var currentSlide=$('.active-slide');
  15.         var nextSlide=currentSlide.next();
  16.         if(nextSlide.length===0) nextSlide=$('.slide').first();
  17.         currentSlide.fadeOut(120).removeClass('active-slide');
  18.         nextSlide.fadeIn(120).addClass('active-slide');
  19.         var currentDot = $('.active-dot');
  20.         var nextDot = currentDot.next();
  21.         if(nextDot.length===0) nextDot = $('.dot').first();
  22.         currentDot.removeClass('active-dot');
  23.         nextDot.addClass('active-dot');
  24.     });
  25.     $('.arrow-prev').click(function() {
  26.         var currentSlide=$('.active-slide');
  27.         var prevSlide=currentSlide.prev();
  28.         if(prevSlide.length===0) prevSlide=$('.slide').last();
  29.         currentSlide.fadeOut(120).removeClass('active-slide');
  30.         prevSlide.fadeIn(120).addClass('active-slide');
  31.         var currentDot = $('.active-dot');
  32.         var prevDot = currentDot.prev();
  33.         if(prevDot.length===0) prevDot = $('.dot').last();
  34.         currentDot.removeClass('active-dot');
  35.         prevDot.addClass('active-dot');
  36.     });
  37.     if ($(window).width() <= 580) {
  38.         $('#swap-right').after($('#swap-left'));
  39.         }
  40.     else {
  41.         return false;
  42.         }
  43. };
  44. $(document).ready(main);
Advertisement
Add Comment
Please, Sign In to add comment