October 20, 2017 at 2:56 am #261556
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.October 20, 2017 at 3:25 am #261558Paulie_DModerator
You can’t animate a height to
autoeither in CSS or JS.
I’d suggest you use another reveal method.October 20, 2017 at 4:49 am #261568
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.October 20, 2017 at 4:55 am #261569Paulie_DModerator
You’need to include a function to select all the
.questionelements that are not
$thisand close the child elements.October 20, 2017 at 5:09 am #261570
Actually I have no idea how it works.
There is no height: 0 in the code, but it does close! How?October 20, 2017 at 5:52 am #261571ShikkedielParticipant
Never mind, there seems to be more to the question…October 20, 2017 at 6:02 am #261572
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”.October 20, 2017 at 7:08 am #261582bearheadParticipant
Hi Ayala, is this the functionality you are looking for?
I made the
.moredivs children of their respective
.questiondivs (I think it simplifies the js) .
Edit – didn’t see bearhead’s post (looks more straightforward)…
And I messed something up meanwhile anyway. :-)October 20, 2017 at 8:46 am #261586
I would like to close both.October 20, 2017 at 8:58 am #261591bearheadParticipant
I’ve updated my pen to allow both to be closed at the same time.October 20, 2017 at 9:48 am #261593
It is perfect! :)
- You must be logged in to reply to this topic.