$(document).foundation();var didScroll,lastScrollTop=0,scrollAmount=10,navbarHeight=$(".slideUp").outerHeight();$(window).scroll(function(a){didScroll=!0});setInterval(function(){didScroll&&(hasScrolled(),didScroll=!1)},250);function hasScrolled(){var a=$(this).scrollTop();Math.abs(lastScrollTop-a)<=scrollAmount||(a>lastScrollTop&&a>navbarHeight?$(".slideUp").css({top:-$(this).outerHeight()}):a+$(window).height()<$(document).height()&&$(".slideUp").css({top:0}),lastScrollTop=a)};
function hasScrolled(){"use strict";var l=$(window).scrollTop();Math.abs(lastScrollTop-l)<=scrollAmount||(l>lastScrollTop&&l>navbarHeight?$(".slideUp").css({top:-$(window).outerHeight()}):l+$(window).height()<$(document).height()&&$(".slideUp").css({top:0}),lastScrollTop=l)}var $window=$(window),didScroll,lastScrollTop=0,scrollAmount=10,navbarHeight=$(".slideUp").outerHeight();$(window).scroll(function(l){didScroll=!0}),setInterval(function(){didScroll&&(hasScrolled(),didScroll=!1)},250);
Update minified version