Skip to content
This repository has been archived by the owner on Aug 30, 2018. It is now read-only.

Sticky header and mobile drawers not cooperating. #556

Open
listeven95 opened this issue Jul 11, 2016 · 2 comments
Open

Sticky header and mobile drawers not cooperating. #556

listeven95 opened this issue Jul 11, 2016 · 2 comments

Comments

@listeven95
Copy link

Hi all,

I've been using sticky.js on my navigation bar on the Timber theme. However, it doesn't work well on mobile as it doesn't stick and the navigation bar sometimes shows up with some padding at the top. Furthermore, it doesn't cooperate well with the drawer as the position changes back to the top after opening.

Anyone have any solutions?

@heymynameisrob
Copy link

Do you want the navbar to stick when as soon as your scroll down? The plug-in is probably causing some issues.

If you're using jQuery, use this:

NB change the 85 to the height of your navbar.

$(window).scroll(function() {
    var scroll = $(window).scrollTop();            

    if (scroll >= 85) {        
      $(".navbar").addClass("scrolled");            
    } else {
      $(".navbar").removeClass("scrolled");      
    }
});

@cshold
Copy link
Contributor

cshold commented Jul 18, 2016

This isn't related to the framework so am closing this issue. Feel free to continue the discussion here or in our forums.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants