Give help. Get help.
My jQuery doesn’t work.
I would like that if I click one question, the text would be visible. and if I click there again, it should be invisible again.
And the other thing, I would like that only one text of question would be visibly in one time.
You can’t animate a height to auto either in CSS or JS.
I’d suggest you use another reveal method.
I changed the code.
It works only the height is “auto” as default, but I would like it “0”.
The other thing, I would like that if I click one of question, then the other closes.
You’need to include a function to select all the .question elements that are not $this and close the child elements.
Actually I have no idea how it works.
There is no height: 0 in the code, but it does close! How?
Never mind, there seems to be more to the question…
I am sorry, in meantime I have changed the code. :)
I am almost there.
Now my main problem is that the “$(this).next()” doesn’t work.
I want to reach the div “.more” after the div “.question”.
Hi Ayala, is this the functionality you are looking for?
I made the .more divs children of their respective .question divs (I think it simplifies the js) .
Edit – didn’t see bearhead’s post (looks more straightforward)…
And I messed something up meanwhile anyway. :-)
I would like to close both.
I’ve updated my pen to allow both to be closed at the same time.
It is perfect! :)
You must be logged in to reply to this topic.