$(document).ready(function() /* ==================== Pre Loader ==================== */ {setTimeout(function() { $('#loading').fadeOut('slow', function() {}); }, 300); /* ==================== Dynamic Header Mobile ==================== */ $(window).load(function() { var viewportWidth = $(window).width(); if (viewportWidth < 1025) { $('.wft-layout').css({"padding-top" : $(".top").height() + "px"}); } }); /* ==================== 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 Animate Down ==================== */ $(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"); }); /* ==================== Quote slider ==================== */ $(function() { var owl = $(".quote-slider"); owl.owlCarousel({ pagination: false, navigation: false, slideSpeed : 300, autoPlay: 9000, loop: true, items: 1, itemsDesktop : false, itemsDesktopSmall : false, itemsTablet: false, itemsMobile: false, autoHeight: true }); // 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: 1, itemsDesktop : false, itemsDesktopSmall : false, itemsTablet: false, itemsMobile: false, autoHeight: true }); // 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); }); /* ==================== weebly form placeholders ==================== */ jQuery(function(){ var $ = jQuery; function givePlacholders(){ $('.wsite-form-container input[type=text], .wsite-form-container textarea').each(function(){ var labelText = $(this).parents('.wsite-form-field:not(.wsite-phone-field)').children('label').text(), subLabelText = $(this).next('.wsite-form-sublabel').text(), $that = $(this); $that.attr('placeholder', subLabelText + ' ' + labelText); $that.parents('.wsite-form-field:not(.wsite-phone-field)').children('label').hide(); $that.next('.wsite-form-sublabel').hide(); $that.on('change', function(){ if ( $that.val() != '' ) { $that.addClass('wft-nbg'); }else{ $that.removeClass('wft-nbg'); } }); }); } givePlacholders(); }); /* ==================== one page nav ==================== */ $('#nav').onePageNav({ currentClass: 'current', changeHash: false, scrollSpeed: 1200 }); //Wow new WOW().init(); //Footer Reveal $(function() { $('footer').footerReveal(); }); });