// Generated by CoffeeScript 1.4.0 /* Sticky Elements Shortcut for jQuery Waypoints - v2.0.2 Copyright (c) 2011-2013 Caleb Troughton Dual licensed under the MIT license and GPL license. https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt */ (function(){(function(t,n){if(typeof define==="function"&&define.amd){return define(["jquery","waypoints"],n)}else{return n(t.jQuery)}})(this,function(t){var n,e;n={wrapper:'
',stuckClass:"stuck"};e=function(n,e){n.wrap(e.wrapper);n.each(function(){var n;n=t(this);n.parent().css('min-height',n.outerHeight());return true});return n.parent()};return t.waypoints("extendFn","sticky",function(r){var i,a;r=t.extend({},t.fn.waypoint.defaults,n,r);i=e(this,r);a=r.handler;r.handler=function(n){var e,i;e=t(this).children(":first");i=n==="down"||n==="right";e.toggleClass(r.stuckClass,i);if(a!=null){return a.call(this,n)}};i.waypoint(r);return this})})}).call(this); (function($) { // run this code on page load (AKA DOM load) $(window).load(function() { var header_height = $('.header-wrap').height(), offset_value = - header_height; $('.header-wrap').waypoint('sticky', { offset: offset_value }); }); $( function () { /* set variables locally for increased performance*/ var scroll_timer; var displayed = false; var $message = $('.header-wrap'); var $window = $(window); /* react to scroll event on window*/ $window.scroll( function () { var top = $('.sticky-wrapper').height(); // Check page is not using acoda-page-animate window.clearTimeout(scroll_timer); scroll_timer = window.setTimeout(function () { // use a timer for performance if( $window.scrollTop() <= top ) // hide if at the top of the page { displayed = false; if( $('.site-inwrap').hasClass('header_transparent') ) { $message.addClass('header_transparent').removeClass('animate'); } else { $message.removeClass('animate'); } } else if( displayed == false ) // show if scrolling down { displayed = true; if( $('.site-inwrap').hasClass('header_transparent') ) { $message.removeClass('header_transparent').stop(true, true).addClass('animate'); } else { $message.stop(true, true).addClass('animate'); } } }, 50,"easeInOutCubic"); } ); }); })(jQuery);