(function($) { "use strict"; //Update Header Style + Scroll to Top function headerStyle() { if($('.main-header').length){ var windowpos = $(window).scrollTop(); if (windowpos >= 80) { $('.main-header').addClass('fixed-header'); $('.scroll-to-top').fadeIn(300); } else { $('.main-header').removeClass('fixed-header'); $('.scroll-to-top').fadeOut(300); } } } headerStyle(); //Submenu Dropdown Toggle if($('.main-menu li.dropdown ul').length){ $('.main-menu li.dropdown').append('
'); //Dropdown Button $('.main-menu li.dropdown .dropdown-btn').on('click', function() { $(this).prev('ul').slideToggle(500); }); //Disable dropdown parent link $('.navigation li.dropdown > a').on('click', function(e) { e.preventDefault(); }); } //Revolution Slider if($('.revolution-slider .tp-banner').length){ jQuery('.revolution-slider .tp-banner').show().revolution({ delay:2000, startwidth:1200, startheight:720, hideThumbs:600, thumbWidth:80, thumbHeight:50, thumbAmount:5, navigationType:"bullet", navigationArrows:"0", navigationStyle:"preview4", touchenabled:"on", onHoverStop:"off", swipe_velocity: 0.7, swipe_min_touches: 1, swipe_max_touches: 1, drag_block_vertical: false, parallax:"mouse", parallaxBgFreeze:"on", parallaxLevels:[7,4,3,2,5,4,3,2,1,0], keyboardNavigation:"off", navigationHAlign:"center", navigationVAlign:"bottom", navigationHOffset:0, navigationVOffset:20, soloArrowLeftHalign:"left", soloArrowLeftValign:"center", soloArrowLeftHOffset:20, soloArrowLeftVOffset:0, soloArrowRightHalign:"right", soloArrowRightValign:"center", soloArrowRightHOffset:20, soloArrowRightVOffset:0, shadow:0, fullWidth:"on", fullScreen:"off", spinner:"spinner4", stopLoop:"off", stopAfterLoops:-1, stopAtSlide:-1, shuffle:"off", autoHeight:"off", forceFullWidth:"on", hideThumbsOnMobile:"on", hideNavDelayOnMobile:1500, hideBulletsOnMobile:"on", hideArrowsOnMobile:"on", hideThumbsUnderResolution:0, hideSliderAtLimit:0, hideCaptionAtLimit:0, hideAllCaptionAtLilmit:0, startWithSlide:0, videoJsPath:"", fullScreenOffsetContainer: "" }); } //Related Posts Carousel if ($('.related-posts-carousel').length) { $('.related-posts-carousel').owlCarousel({ loop:true, margin:30, nav:true, smartSpeed: 500, autoplay: 5000, navText: [ '', '' ], responsive:{ 0:{ items:1 }, 600:{ items:1 }, 1024:{ items:2 }, 1400:{ items:2 } } }); } //Testimonials Carousel Slider if ($('.testimonials-carousel').length) { $('.testimonials-carousel').owlCarousel({ loop:true, margin:60, nav:true, autoplayHoverPause:false, autoplay: 5000, smartSpeed: 700, navText: [ '', '' ], responsive:{ 0:{ items:1 }, 600:{ items:1 }, 760:{ items:2 }, 1024:{ items:3 }, 1100:{ items:3 } } }); } //Sponsors Slider if ($('.sponsors-slider').length) { $('.sponsors-slider').owlCarousel({ loop:true, margin:0, nav:true, smartSpeed: 500, autoplay: 4000, navText: [ '', '' ], responsive:{ 0:{ items:1 }, 480:{ items:2 }, 600:{ items:2 }, 800:{ items:3 }, 1200:{ items:4 } } }); } //Accordion Box if($('.accordion-box').length){ $(".accordion-box").on('click', '.accord-btn', function() { if($(this).hasClass('active')!==true){ $('.accordion .accord-btn').removeClass('active'); } if ($(this).next('.accord-content').is(':visible')){ $(this).removeClass('active'); $(this).next('.accord-content').slideUp(300); }else{ $(this).addClass('active'); $('.accordion .accord-content').slideUp(300); $(this).next('.accord-content').slideDown(300); } }); } // Fact Counter function factCounter() { if($('.fact-counter').length){ $('.fact-counter .column.animated').each(function() { var $t = $(this), n = $t.find(".count-text").attr("data-stop"), r = parseInt($t.find(".count-text").attr("data-speed"), 10); if (!$t.hasClass("counted")) { $t.addClass("counted"); $({ countNum: $t.find(".count-text").text() }).animate({ countNum: n }, { duration: r, easing: "linear", step: function() { $t.find(".count-text").text(Math.floor(this.countNum)); }, complete: function() { $t.find(".count-text").text(this.countNum); } }); } }); } } //LightBox / Fancybox if($('.lightbox-image').length) { $('.lightbox-image').fancybox({ openEffect : 'elastic', closeEffect : 'elastic', helpers : { media : {} } }); } //Sortable Masonary with Filters function enableMasonry() { if($('.sortable-masonry').length){ var winDow = $(window); // Needed variables var $container=$('.sortable-masonry .items-container'); var $filter=$('.sortable-masonry .filter-btns'); $container.isotope({ filter:'*', masonry: { columnWidth : 1 }, animationOptions:{ duration:1000, easing:'linear' } }); // Isotope Filter $filter.find('li').on('click', function(){ var selector = $(this).attr('data-filter'); try { $container.isotope({ filter : selector, animationOptions: { duration: 1000, easing : 'linear', queue : false } }); } catch(err) { } return false; }); winDow.bind('resize', function(){ var selector = $filter.find('li.active').attr('data-filter'); $container.isotope({ filter : selector, animationOptions: { duration: 1000, easing : 'linear', queue : false } }); }); var filterItemA = $('.sortable-masonry .filter-btns li'); filterItemA.on('click', function(){ var $this = $(this); if ( !$this.hasClass('active')) { filterItemA.removeClass('active'); $this.addClass('active'); } }); } } enableMasonry(); //Gallery With Filters List if($('.filter-list').length){ $('.filter-list').mixItUp({}); } // Scroll to a Specific Div if($('.scroll-to-target').length){ $(".scroll-to-target").on('click', function() { var HeaderHeight = $('.header-lower').height(); var target = $(this).attr('data-target'); // animate $('html, body').animate({ scrollTop: $(target).offset().top - HeaderHeight }, 1000); }); } /* if($('.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: false, // trigger animations on mobile devices (default is true) live: true // act on asynchronously loaded content (default is true) } ); wow.init(); }*/ /* ========================================================================== When document is Scrollig, do ========================================================================== */ $(window).on('scroll', function() { headerStyle(); factCounter(); }); })(window.jQuery);