There is a header that is located above the navigation menu. It is necessary to make so that the navigation when scrolling and passing through the header attached navigation block, which is naturally located below the header. The code seems to be under this implementation. There are a lot of options for its implementation with other plugins and just using js and css. In this case, I just need to attach it. The code is as follows:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> <script> $(document).scroll (function() { if ($(document).scrollTop() > $('header').height () + 10) $('nav').addClass ('fixed'); else $('nav').removeClass ('fixed'); )}; </script> Perhaps the script needs to be inserted next to the <meta> , but I don’t think this is the problem. I can also give more markup, but I do not think this is the problem. If there is such a question, I can quote in the comments. And also the class is added to this, but this is also not so important the main thing that the script worked:
.fixed{ position: fixed; top: 0; opacity: 0.97; }
...ss ('fixed') )};. It is necessary});, not)};. And so, your example is quite working. - entithat