/* Author : theme_crazy Template Name: Manali - Tour & Travels Agency Template Version : 1.0 */ (function($) { "use strict"; // Preloader jQuery(window).on('load', function() { preloader(); // Gallery Filter if(jQuery('.gallery-outer .gallery-items').length > 0){ jQuery('.gallery-outer .gallery-items').filterizr(); } jQuery('#filter-list li').on("click", function(){ jQuery('#filter-list li').removeClass('active'); jQuery(this).addClass('active'); }); }); // Animation section if(jQuery('.wow').length){ var wow = new WOW( { boxClass: 'wow', // animated element css class (default is wow) animateClass: 'animated', // animation css class (default is animated) offset: 0, // distance to the element when triggering the animation (default is 0) mobile: true, // trigger animations on mobile devices (default is true) live: true // act on asynchronously loaded content (default is true) } ); wow.init(); } // Popup jQuery('.venobox').venobox(); jQuery("#sidebar").stick_in_parent(); // Back to top jQuery('.back-top a').on('click', function(event) { jQuery('body,html').animate({scrollTop:0},800); return false; }); jQuery(window).on('scroll', function() { // Back to top if(jQuery(this).scrollTop()>150){ jQuery('.back-top').fadeIn(); } else{ jQuery('.back-top').fadeOut(); } }); // Preload function preloader(){ jQuery(".preloaderimg").fadeOut(); jQuery(".preloader").delay(200).fadeOut("slow").delay(200, function(){ jQuery(this).remove(); }); } // Slider Caption Animation function doAnimations( elems ) { //Cache the animationend event in a variable var animEndEv = 'webkitAnimationEnd animationend'; elems.each(function () { var $this = $(this), $animationType = $this.data('animation'); $this.addClass($animationType).one(animEndEv, function () { $this.removeClass($animationType); }); }); } //Variables on page load var $myCarousel = $('#banner'), $firstAnimatingElems = $myCarousel.find('.item:first').find("[data-animation ^= 'animated']"); //Initialize carousel $myCarousel.carousel(); //Animate captions in first slide on page load doAnimations($firstAnimatingElems); //Pause carousel $myCarousel.carousel('pause'); //Other slides to be animated on carousel slide event $myCarousel.on('slide.bs.carousel', function (e) { var $animatingElems = $(e.relatedTarget).find("[data-animation ^= 'animated']"); doAnimations($animatingElems); }); })(jQuery);