Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** hasScrolled:
- An event driven function for toggling the expansion and shrinkion of
- the main menu bar */
- function hasScrolled() {
- var st = $(this).scrollTop();
- // Make sure they scroll more than delta
- if(Math.abs(lastScrollTop - st) <= delta)
- return;
- // If they scrolled down and are past the navbar, add class .nav-up.
- // This is necessary so you never see what is "behind" the navbar.
- if (st > lastScrollTop && st > navbarHeight){
- // Scroll Down
- $('header').removeClass('nav-down').addClass('nav-up');
- document.getElementById('imgHolder').classList.toggle('rotated');
- //document.body.style.paddingTop = '50px';
- shrink("logo");
- } else {
- if (st == 0) {
- $('header').removeClass('nav-up').addClass('nav-down');
- document.getElementById('imgHolder').classList.toggle('rotated');
- //document.body.style.paddingTop = '250px';
- expand("logo");
- }
- /*// Scroll Up
- if(st + $(window).height() < $(document).height()) {
- $('header').removeClass('nav-up').addClass('nav-down');
- }*/
- }
- lastScrollTop = st;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement