WordPress.org

Forums

Hemingway
[resolved] unstick sticky menu while mobile nav is opened (4 posts)

  1. muzli
    Member
    Posted 10 months ago #

    Hi there!

    Is it possible to make the sticky menu unsticked while the mobile nav is opened?

    Thanks for any help!
    Bence

    p.s.: I made the menu sticky this way.

    (my site is: muzli.hostoi.com)

  2. nikola00219
    Member
    Posted 10 months ago #

    Well this was easy to solve. You have to change the way you load sticky function in global.js to looks like this:

    // Sticky Menu
        $(window).load(function(){
    	if ($(window).width() > 800) {
    	    $(".navigation").sticky({ topSpacing: 0 });
    	}
        });

    I like the way you use up-to-the-top in your menu. I was able to put it in mine, but how did you make it disappear when you are at the top of the page?

  3. muzli
    Member
    Posted 10 months ago #

    Well unfortunately this won't solve my problem fully. In this case the sticky menu will be disabled at all if the user views it with mobile. However I would like to disable it only if the mobile menu is in opened position.

    Answer to your question:
    It is connected with the sticky menu. In default the up-to-the-top class isn't displayed and then I used the .is-sticky .up-to-the-top selector to set the display value to block. Hope it helps you out! :)

    Also waiting for better solution for my original question.
    Thanks!

  4. nikola00219
    Member
    Posted 10 months ago #

    Thanks for your explanation. I already found the answer few hours after my post but I am new to wordpress.org and didn't know I couldn't edit my comment after some time.

Reply

You must log in to post.

About this Theme

About this Topic