$(document).ready(function() /* ==================== Pre Loader ==================== */ {setTimeout(function() { $('#loading').fadeOut('slow', function() {}); }, 300); /* ==================== Live tog Demo Can Remove ==================== */ $('#live-tog').click(function() { $('body').toggleClass("scroller-menu-on"); $('body').toggleClass("scroller-menu-off"); }); $('.wft-btn').click(function() { $('body').toggleClass("live-menu-on"); }); /* ==================== Home Slider ==================== */ $(function() { var owl = $(".home-slider"); owl.owlCarousel({ pagination: false, navigation: false, slideSpeed : 1000, items : 1, autoPlay: 9000, loop: true, itemsDesktop : false, itemsDesktopSmall : false, itemsTablet: false, itemsMobile: false, afterAction: afterAction }); // Custom navigation $(".slide-next").click(function() { owl.trigger('owl.next'); }) $(".slide-prev").click(function() { owl.trigger('owl.prev'); }) }); function changeClass(slide){ setTimeout(function(){ $(".owl-item").each(function(){ if ($(this).index() === slide){ $(this).addClass("active"); } else{ $(this).removeClass("active"); } }); },500); } function afterAction(){ changeClass(this.owl.currentItem); } /* ==================== Top bar height effect one page scroller layout ==================== */ $(window).bind("scroll", function() { if ($(this).scrollTop() > 300) { $(".top-bar").removeClass("tb-large").addClass("tb-small animated fadeInDown"); } else { $(".top-bar").removeClass("tb-small animated fadeInDown").addClass("tb-large"); } }); /* ==================== Scroller Menu toggle ==================== */ $('#toggle').click(function(e) { e.stopPropagation(); }); $('html').click(function(e) { if (!$('.toggle').is($(e.target))) { $('#toggle').prop("checked", false); } }); /* ==================== Multi Menu toggle ==================== */ $('.hamburger').click(function() { $('body').toggleClass("menu-open"); }); /* ==================== Service slider ==================== */ $(function() { var owl = $(".services-slider"); owl.owlCarousel({ pagination: false, navigation: false, items: 4, itemsDesktop: [1920, 3], itemsTablet: [1200, 2], itemsMobile: [520, 1] }); // Custom navigation $(".ss-next").click(function() { owl.trigger('owl.next'); }) $(".ss-prev").click(function() { owl.trigger('owl.prev'); }) }); /* ==================== Testimonial slider ==================== */ $(function() { var owl = $(".wft-testimonial-slider"); owl.owlCarousel({ pagination: true, navigation: false, slideSpeed : 300, autoPlay: 9000, loop: true, items: 2, itemsDesktop: [1920, 2], itemsTablet: [1280, 1], itemsMobile: [410, 1], autoHeight: false }); // Custom navigation $(".slide-next").click(function() { owl.trigger('owl.next'); }) $(".slide-prev").click(function() { owl.trigger('owl.prev'); }) }); /* ==================== Number Counters ==================== */ jQuery(document).ready(function( $ ) { $('.counter').counterUp({ delay: 10, time: 5000 }); }); /* ==================== Gallery Mobile ==================== */ $('.imageGallery').each(function(){ if ($(this).children('div').length <= 25) { $(this).children('div').addClass('fullwidth-mobile'); } }); /* ==================== Scrollto ==================== */ $(".back-top").hide(); // fade in #scroll-top $(window).scroll(function () { if ($(this).scrollTop() > 150) { $('.back-top').fadeIn(); } else { $('.back-top').fadeOut(); } }); $(function() { $('.scrollto').bind('click.scrollto', function(e) { e.preventDefault(); var target = this.hash, $target = $(target); $('html, body').stop().animate({ 'scrollTop': $target.offset().top - 0 }, 900, 'swing', function() { window.location.hash = target; }); }); }); /* ==================== Equal height ==================== */ $('.equal').children('.wft-col').equalizeHeight(); $(window).resize(function() { $('.equal').children('.wft-col').equalizeHeight(); setTimeout(function() { $('.equal').children('.wft-col').equalizeHeight(); }, 100); setTimeout(function() { $('.equal').children('.wft-col').equalizeHeight(); }, 400); setTimeout(function() { $('.equal').children('.wft-col').equalizeHeight(); }, 1400); setTimeout(function() { $('.equal').children('.wft-col').equalizeHeight(); }, 2400); }); setTimeout(function() { $(window).trigger('resize scroll'); }, 1000); setTimeout(function() { $(window).trigger('resize scroll'); }, 3000); $(window).load(function() { $('.equal').children('.wft-col').equalizeHeight(); $(window).trigger('resize scroll'); setTimeout(function() { $('.equal').children('.wft-col').equalizeHeight(); }, 1000); setTimeout(function() { $('.equal').children('.wft-col').equalizeHeight(); }, 1300); }); /* ==================== tabs ==================== */ $(".tabs-container").each(function () { var $history = $(this).attr('data-history'); if ($history != undefined && $history == 'true') { $history = true; } else { $history = false; } var $initialIndex = $(this).attr('data-initialIndex'); if ($initialIndex == undefined) { $initialIndex = 0; } $("ul.tabs", this).tabs("div.tab-content > div", { tabs: 'a', effect: 'fade', fadeOutSpeed: -200, history: $history, initialIndex: $initialIndex }); }); /* ==================== one page nav ==================== */ $('#nav').onePageNav({ currentClass: 'current', changeHash: false, scrollSpeed: 1200 }); //Wow new WOW().init(); });