I have a minor issue with my dropdown menu when switching pages <p>I have a small issue with my dropdown menu when switching to another page. When I press my menu label button, the navigation bar slides down and when I then proceed to another page the dropdown menu acts if it was open but it is not so when I press the menu label button again the navigation bar slides up instead of down and after that it works normally. </p> <p><strong>What do I do to make the slide bar return to normal state when I switch pages?</strong> I hope you understand what I mean, otherwise I will try to clarify</p> <p><strong>HTML</strong></p> <pre><code>&lt;nav id="navBar"&gt; &lt;ul id="mainNav"&gt; &lt;li class="hem"&gt;&lt;a href="index.html"&gt;Hem&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="kontakt.html"&gt;Kontakt&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="om.html"&gt;Om&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/nav&gt; </code></pre> <p><strong>CSS</strong></p> <pre><code>#navBar { display:none; position:relative; } #navBar.active{ display:block; height:auto; } #mainNav { background:#202020; } #mainNav li { padding:6px 0; } #mainNav a { color:white; font-weight:bold; } #mainNav li:hover { background-color:#f3ba32; } </code></pre> <p><strong>JQUERY</strong></p> <pre><code>$("#menulabel").click(function() { $("#navBar").toggleClass("active").slideToggle(300); }); </code></pre>