TheWebMan Posted February 28, 2015 Share Posted February 28, 2015 Let's say we have this code. $(document).ready(function() { $('#head button').click(function() { $('#down').slideDown(200); }); }); How can I make as if when I click on the #head is the #down content shows, but what do I do if I want it to dissapear when I click the button again? I tried using this aswell $('head button').click(function() { $('#down').hide(); This code works but it's buggy. also, when It closes I want to be able to open it again, How could I make it do that? Quote Link to comment https://forums.phpfreaks.com/topic/294968-jquery-help/ Share on other sites More sharing options...
NetGuru87 Posted April 28, 2015 Share Posted April 28, 2015 (edited) Like in Toggle? http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_toggle You should be able to apply that example to whatever you are doing. Edited April 28, 2015 by NetGuru87 Quote Link to comment https://forums.phpfreaks.com/topic/294968-jquery-help/#findComment-1510191 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.