Hi to all!! I'm new about jQuery and I cannot find the right way to .hide a div and then .show it with the same button at the second click... And also the text of the button has to change from "Click to hide" to become "Click to show".. How can I make it?? I really need it... any tip please? Thx so much guys!!
All you need is jQuery toggle function: http://docs.jquery.com/Effects/toggle $("button").click(function () { $("p").toggle("slow"); });
I thank you so much !! I thought I needed an IF() condition or something like that... this means that I have to study jQuery deeper now!! And how can I change the text of the button when the image is colsed? BTW: I see that this kind of effect is different from a similar effect with Javascript... I am not sure but the Javascript effect seems to be more professional when it hides or shows an element... isn't it?? Thx again!!