S
S
Sergey Shkurikhin2020-06-29 20:50:52
WordPress
Sergey Shkurikhin, 2020-06-29 20:50:52

How to make the top drawer behave as standard?

The navigation bar on top is behaving very strangely, namely, it seems that it slides out when it wants to. How can I make it slide out when you scroll down and hide at the top?
Is there a standard code that is used in the themes for the top bar?

https://blagomart.ru/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Ermilov, 2020-07-05
@shkyrikhin99

You have a function in one of the files (custom) due to which the problem seems to arise. You can try to rewrite it like this:

sticky_header: function () {

                    var position = jQuery('header').scrollTop(); 
                    var headerBar = jQuery('header').height();

                    jQuery(window).scroll(function() {

                        var scroll = jQuery(window).scrollTop();

   		if(scroll < position + headerBar) {   

                        jQuery(".sticky-header").removeClass("stick");
                        $(".search-wrapper").removeClass("open");

                        }else{

                        jQuery(".sticky-header").addClass("stick");

                        }

                    });            

        },

You need to try, because I can’t predict the behavior right away, but it seems to help move in the right direction.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question