The script doesn't work responsible for the appearance of the element when best personal Finance?

Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
Here is the website
here is a script which I use

The script is pretty simple, but the element that should hide still displayed or hidden after a small scroll and after 595px appears again. Here is the photo of the item which needs to be hidden. If you scroll a bit down and up at once he will disappear and appear according to the script. But I can not understand why it is displayed immediately. after all, he should not. Prescribed script where possible did not help
5ae5b0939b1dc511862366.png Is it possible that this is due to the fact that the item was originally written display: flex; ???
by | 16 views

1 Answer

0 like 0 dislike
What do you mean "immediately"? To scrolling? Well, he is set to change only after scrolling.
$( document ).ready(function() { $('#menu-fixed').hide(); $(window).scroll(function(){ if($(window).scrollTop()>595){ $('#menu-fixed').show(); }else{ $('#menu-fixed').hide(); } }); });

or don't touch the js and put it in default in .css
#menu-fixed { display: none; }
110,608 questions
257,187 answers
40,796 users