css - jQuery .show() is not working in Firefox -
the code below suppose have menu hidden until #menubutton clicked on, clicking on not revealing menu. used work has stopped , have no idea why. works in chrome not in firefox.
<a id='menubutton' href="#"> <img src="/wp-content/themes/helpline/images/mobilemenu.png"> <div id='menubuttontext'> menu </div> </a> <ul id='menucontainer'> <li><a href='/'>home</a></li> <li><a href='/services/'>services</a></li> <li><a href='/about-us/'>about us</a></li> <li><a href='/procedures/'>procedures</a></li> <li><a href='/call-back/'>request call back</a></li> <li><a href='/contact/'>contact us</a></li> </ul> <script type="text/javascript"> var inout="0"; $("#menubutton").click(function () { if(inout=="0"){ $("#menucontainer").show("slow"); inout="1"; }else{ $("#menucontainer").hide(); inout="0"; } }); </script>
css:
#menucontainer { display: none; }
make sure loading jquery. try adding head tag:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
here working example jquery loaded , exact code (minus image): http://jsfiddle.net/uyhvkphd/
Comments
Post a Comment