$(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"); }); /* ==================== Top bar height effect one page scroller layout ==================== */ $(window).bind("scroll", function() { if ($(this).scrollTop() > 20) { $("body.side-menu-off .infobar").removeClass("ib-large").addClass("ib-small animated fadeOut"); } else { $("body.side-menu-off .infobar").removeClass("ib-small animated fadeIn").addClass("ib-large"); } }); $(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"); }); /* ==================== Gallery Mobile ==================== */ $('.imageGallery').each(function(){ if ($(this).children('div').length <= 25) { $(this).children('div').addClass('fullwidth-mobile'); } }); /* ==================== 12. Equal height ==================== */ /* Use the .equal class on a row if you want the columns to be equal in height */ $('.equal').children('.col').equalizeHeight(); $(window).resize(function () { $('.equal').children('.col').equalizeHeight(); setTimeout(function () { $('.equal').children('.col').equalizeHeight(); }, 100); setTimeout(function () { $('.equal').children('.col').equalizeHeight(); }, 400); setTimeout(function () { $('.equal').children('.col').equalizeHeight(); }, 1400); setTimeout(function () { $('.equal').children('.col').equalizeHeight(); }, 2400); }); setTimeout(function () { $(window).trigger('resize scroll'); }, 1000); setTimeout(function () { $(window).trigger('resize scroll'); }, 3000); $(window).load(function () { $('.equal').children('.col').equalizeHeight(); $(window).trigger('resize scroll'); setTimeout(function () { $('.equal').children('.col').equalizeHeight(); }, 1000); setTimeout(function () { $('.equal').children('.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(); }); /* ==================== 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; }); }); }); //Wow new WOW().init(); });