'); }); } // CALLBACK TO RUN YOUR CUSTOM CODE AFTER EVERYTHING IS READY }); } } } /* ** smoothScroll ** Use: This will smoothly scroll to the id that was passed to the function. ** Return: N/A ** Parameter(s): to (jQuery "#id") The id of the section to be scolled to. ** offset (int) The amount of space you want to be left on the top of the element after scroll (in a whole number int value) */ function smoothScroll( to, offset ){ if( to.indexOf("#") < 0 ){ to = "#" + to; } //makes sure we have a valid id accessor string var target = $(to); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top - offset //this offset accounts for the fixed menu on the top }, 800, function(){ $("html, body").stop(true, false); }); return false; } } function checkSlideshow() { if($(".hp").length && $(window).width() <= 1023) { if ($(window).scrollTop() <= $("#hp-slideshow").offset().top + $("#hp-slideshow").height()) { if(csSlideshowDescFixed) { $("#hp-slideshow .rs-gallery-desc-cont").removeAttr("style"); csSlideshowDescFixed = false; } } else { if(!csSlideshowDescFixed) { $("#hp-slideshow .rs-gallery-desc-cont").css({ "height": $("#hp-slideshow .rs-gallery-desc-cont").height(), "overflow": "hidden" }); csSlideshowDescFixed = true; } } } }