$(document).ready(function(e) { $(".gallery a img").css({"opacity":"0"}); $(".gallery a img").load(function(e) { $(this).animate({"opacity":"1"}); }); $(".gallery a img").each(function(index, element) { $(this).attr("img-src",$(this).attr("src")); $(this).attr("src","") }); setTimeout(function(){ if($("[rel^='mobilemenu-bottom']").length > 0){ $("[rel^='mobilemenu-bottom']").prettyPhoto({ animation_speed:'fast', slideshow:10000, hideflash: true, /* default_width: $(window).width()-100, default_height: 'auto', */ deeplinking: false, theme:'light_square', social_tools: false, allow_resize: false, show_title:false, modal:false, horizontal_padding:0, markup: '
\ ', changepicturecallback: function(){ $("#pretty_lia").css({"left":($(window).width()/2)-($("#pretty_lia").width()/2)}); if($(".tabs").length > 0){ setTabs(); } } }); } },1000); }); $(window).load(function(){ animateViewport(); $(".gallery a img:in-viewport:not(.object-loaded)").each(function(index, element) { $(this).attr("src",$(this).attr("img-src")); $(this).addClass("object-loaded"); }); $("#callus").click(function(e) { ga('send', 'event', "Click to Call", "Header Clicked", "", "0"); }); $("#mobilemenu .left").click(function(e) { ga('send', 'event', "Click to Call", "Mobile Header Clicked", "", "0"); }); $("#mobile-calltoaction").click(function(e) { ga('send', 'event', "Click to Call", "Mobile Green Button Clicked", "", "0"); }); if($("#popup-location iframe").length > 0){ var $mobile_map = $("#popup-location iframe").attr("src"); $("#popup-location iframe").attr("src",""); $("a[rel='mobilemenu-bottom']").click(function(e) { $("#popup-location iframe").attr("src",$mobile_map); }); } }); $(window).scroll(function (event) { animateViewport(); $(".gallery a img:in-viewport:not(.object-loaded)").each(function(index, element) { $(this).attr("src",$(this).attr("img-src")); $(this).addClass("object-loaded"); }); }); $(window).resize(function (event) { animateViewport(); $(".gallery a img:in-viewport:not(.object-loaded)").each(function(index, element) { $(this).attr("src",$(this).attr("img-src")); $(this).addClass("object-loaded"); }); }); function animateViewport(){ $(".animate-in-opacity:in-viewport:not(.animation-in-done)").each(function(index, element) { $animate_in_delay = 300; if($(this).attr('animate-in-delay') != 0 && $(this).attr('animate-in-delay') != "" && $(this).attr('animate-in-delay') != undefined){ $animate_in_delay = $(this).attr('animate-in-delay'); } $(this).delay($animate_in_delay).animate({"opacity":"1"}); }); $(".animate-in-fade:in-viewport:not(.animation-in-done)").each(function(index, element) { $animate_in_delay = 300; if($(this).attr('animate-in-delay') != 0 && $(this).attr('animate-in-delay') != "" && $(this).attr('animate-in-delay') != undefined){ $animate_in_delay = $(this).attr('animate-in-delay'); } $(this).delay($animate_in_delay).animate({ "opacity":"1" },{ step: function(now,fx) { $(this).css('transform','scale('+(0.95+(now/20))+')'); }, duration:'slow', } ); }); $(".animate-in-left:in-viewport:not(.animation-in-done)").each(function(index, element) { $animate_in_delay = 300; if($(this).attr('animate-in-delay') != 0 && $(this).attr('animate-in-delay') != "" && $(this).attr('animate-in-delay') != undefined){ $animate_in_delay = $(this).attr('animate-in-delay'); } $(this).delay($animate_in_delay).animate({ "opacity":"1" },{ step: function(now,fx) { $(this).css('transform','translateX('+(-20+(now*20))+'px)'); }, duration:'slow', } ); }); $(".animate-in-right:in-viewport:not(.animation-in-done)").each(function(index, element) { $animate_in_delay = 300; if($(this).attr('animate-in-delay') != 0 && $(this).attr('animate-in-delay') != "" && $(this).attr('animate-in-delay') != undefined){ $animate_in_delay = $(this).attr('animate-in-delay'); } $(this).delay($animate_in_delay).animate({ "opacity":"1" },{ step: function(now,fx) { $(this).css('transform','translateX('+(20-(now*20))+'px)'); }, duration:'slow', } ); }); $(".animate-in-top:in-viewport:not(.animation-in-done)").each(function(index, element) { $animate_in_delay = 300; if($(this).attr('animate-in-delay') != 0 && $(this).attr('animate-in-delay') != "" && $(this).attr('animate-in-delay') != undefined){ $animate_in_delay = $(this).attr('animate-in-delay'); } $(this).delay($animate_in_delay).animate({ "opacity":"1" },{ step: function(now,fx) { $(this).css('transform','translateY('+(-20+(now*20))+'px)'); }, duration:'slow', } ); }); $(".animate-in-bottom:in-viewport:not(.animation-in-done)").each(function(index, element) { $animate_in_delay = 300; if($(this).attr('animate-in-delay') != 0 && $(this).attr('animate-in-delay') != "" && $(this).attr('animate-in-delay') != undefined){ $animate_in_delay = $(this).attr('animate-in-delay'); } $(this).delay($animate_in_delay).animate({ "opacity":"1" },{ step: function(now,fx) { $(this).css('transform','translateY('+(20-(now*20))+'px)'); }, duration:'slow', } ); }); $(".animate-in-opacity:in-viewport:not(.animation-in-done)").addClass("animation-in-done"); $(".animate-in-fade:in-viewport:not(.animation-in-done)").addClass("animation-in-done"); $(".animate-in-left:in-viewport:not(.animation-in-done)").addClass("animation-in-done"); $(".animate-in-right:in-viewport:not(.animation-in-done)").addClass("animation-in-done"); $(".animate-in-top:in-viewport:not(.animation-in-done)").addClass("animation-in-done"); $(".animate-in-bottom:in-viewport:not(.animation-in-done)").addClass("animation-in-done"); }