$(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 : 300, 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); } /* ==================== Fixed Nav ==================== */ window.onscroll = function() {myFunction()}; var header = document.getElementById("menu-container"); var sticky = header.offsetTop; function myFunction() { if (window.pageYOffset >= sticky) { header.classList.add("sticky"); } else { header.classList.remove("sticky"); } } /* ==================== 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"); }); /* ==================== Testimonial slider ==================== */ $(function() { var owl = $(".wft-testimonial-slider"); owl.owlCarousel({ pagination: true, navigation: false, slideSpeed : 300, autoPlay: 9000, items : 2, loop: true, autoHeight: true, itemsDesktop: [1180, 2], itemsTablet: [1025, 1], itemsMobile: [450, 1] }); // Custom navigation $(".slide-next").click(function() { owl.trigger('owl.next'); }) $(".slide-prev").click(function() { owl.trigger('owl.prev'); }) }); /* ==================== Partner slider ==================== */ $(function() { var owl = $(".partner-sliders"); owl.owlCarousel({ pagination: false, navigation: false, slideSpeed : 700, autoPlay: 15000, items : 4, loop: true, autoHeight: false, itemsDesktop: [1180, 3], itemsTablet: [1025, 2], itemsMobile: [450, 1] }); // Custom navigation $(".ss-next").click(function() { owl.trigger('owl.next'); }) $(".ss-prev").click(function() { owl.trigger('owl.prev'); }) }); /* ==================== 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 - 50 }, 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(); });