jQuery(function ($) { 'use strict'; // Toggle Menu for Mobile // MagnificPopup // Slick Slider // Home Slider Animations // gmap // ------------------------------------------------------------- // Toggle Menu for Mobile // ------------------------------------------------------------- mobileDropdown (); function mobileDropdown () { if($('.tr-menu').length) { $('.tr-menu .tr-dropdown').append(function () { return ''; }); $('.tr-menu .tr-dropdown .icon').on('click', function () { $(this).parent('li').children('ul').slideToggle(); }); } } // ------------------------------------------------------------- // MagnificPopup // ------------------------------------------------------------- //$('.video-link').magnificPopup({type:'iframe'}); // ------------------------------------------------------------- // Slick Slider // ------------------------------------------------------------- $(".testimonial-slider").slick({ infinite: true, dots: true, arrows: false, slidesToShow: 1, autoplay:true, autoplaySpeed:10000, slidesToScroll: 1 }); $(".products-slider").slick({ infinite: true, dots: false, slidesToShow: 3, autoplay:true, autoplaySpeed:10000, slidesToScroll: 3, responsive: [ { breakpoint: 992, settings: { slidesToShow: 2, } }, { breakpoint: 768, settings: { slidesToShow: 2, } }, { breakpoint: 500, settings: { slidesToShow: 1, } } ] }); $(".brand-slider").slick({ infinite: true, dots: false, slidesToShow: 4, autoplay:true, autoplaySpeed:10000, slidesToScroll: 1, responsive: [ { breakpoint: 992, settings: { slidesToShow: 3, } }, { breakpoint: 768, settings: { slidesToShow: 2, } }, { breakpoint: 500, settings: { slidesToShow: 1, } } ] }); $(".team-slider").slick({ infinite: true, dots: false, arrows: false, slidesToShow: 3, autoplay:true, autoplaySpeed:10000, slidesToScroll: 3, responsive: [ { breakpoint: 992, settings: { slidesToShow: 2, } }, { breakpoint: 768, settings: { slidesToShow: 2, } }, { breakpoint: 500, settings: { slidesToShow: 1, } } ] }); /*==============================================================*/ // Home Slider Animations /*==============================================================*/ (function( $ ) { //Function to animate slider captions function calibarDoAnimations( 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 = $('#home-carousel'), $firstAnimatingElems = $myCarousel.find('.item:first').find("[data-animation ^= 'animated']"); //Initialize carousel $myCarousel.carousel(); //Animate captions in first slide on page load calibarDoAnimations($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']"); calibarDoAnimations($animatingElems); }); })(jQuery); // ------------------------------------------------------------- // Comment Reply Visiblity // ------------------------------------------------------------- $('.comment-reply-link').on('click', function(){ $('.tr-comments').hide(); }); $('a#cancel-comment-reply-link').on('click', function(){ $('.tr-comments').show(); }); // script end });