php - Keep jQuery collapsible menu bar expanded -


menu collapses when link clicked because loads new page. there anyway can keep menu expanded using php variable?

<ul class="<? echo $page_id; ?>">  <script> $(document).ready(function () {   $('.page_id').slidedown(); // use variable!   $('#nav > li > a').click(function(){   if ($(this).attr('class') != 'active'){     $('#nav li ul').slideup();     $(this).next().slidetoggle();     $('#nav li a').removeclass('active');     $(this).addclass('active');     }   }); }); </script> 

thanks teaching!

on page load open it:

<script> $(document).ready(function () {   //slide down on page load   $('#nav li ul').slidedown();   $('#nav > li > a').click(function(){   if ($(this).attr('class') != 'active'){     $('#nav li ul').slideup();     $(this).next().slidetoggle();     $('#nav li a').removeclass('active');     $(this).addclass('active');     }   }); }); </script> 

Comments

Popular posts from this blog

javascript - JS causing window size to be bigger than necessary - Dropdown bug -

php - Calling a template part from a post -

How to mention the localhost in android -