// JavaScript Document /*-----------------------------------------------------------------------------------*/ /* Preloader /*-----------------------------------------------------------------------------------*/ jQuery.noConflict(); jQuery(document).ready(function() { jQuery("body").fadeIn(500); jQuery(".no-touch .sf-menu a, .no-touch .widget_qtranslate a").click(function(event){ event.preventDefault(); linkLocation = this.href; jQuery("body").fadeOut(250, redirectPage); }); function redirectPage() { window.location = linkLocation; } }); jQuery(window).load(function(){ jQuery(".slideshowpreload").fadeOut('slow'); }); /*-----------------------------------------------------------------------------------*/ /* Resize Image to Fit Screen /*-----------------------------------------------------------------------------------*/ /*if ( jQuery("#sizr").length > 0 ) { jQuery(document).ready(function() { var jQueryimg = jQuery("#sizr"); var ratio; var offsetX = jQueryimg.offset().left; var offsetY = jQueryimg.offset().top; jQuery(document).ready(function () { ratio = jQueryimg.width() / jQueryimg.height(); jQuery(this).resize(); }); jQuery(window).resize(function () { var viewportWidth = window.innerWidth || document.documentElement.clientWidth; var viewportHeight = window.innerHeight || document.documentElement.clientHeight; var availWidth = viewportWidth - offsetX - 100; var availHeight = viewportHeight - offsetY - 100; if (availWidth / availHeight > ratio) { jQueryimg.height(availHeight); jQueryimg.width(availHeight * ratio); } else { jQueryimg.width(availWidth); jQueryimg.height(availWidth / ratio); } }); }); } */ /*-----------------------------------------------------------------------------------*/ /* Scroll to Top by Andre Gagnon /*-----------------------------------------------------------------------------------*/ jQuery(document).ready(function() { jQuery(window).scroll(function () { var y_scroll_pos = window.pageYOffset; var scroll_pos_test = 50; // set to whatever you want it to be if(y_scroll_pos > scroll_pos_test) { jQuery('.top').fadeIn(1000); jQuery('.iphone').children('.top').css('display', 'none !important'); } else { jQuery('.top').fadeOut(500); } }); jQuery('.top').click(function(){ jQuery('html, body').animate({scrollTop:0}, 500, 'easeOutCubic'); return false; }); }); /*-----------------------------------------------------------------------------------*/ /* FitVid Fluid Video /*-----------------------------------------------------------------------------------*/ jQuery(document).ready(function(){ jQuery(".videocontainer").fitVids(); });