simple-expand
simple-expand copied to clipboard
Add support for accordion mode
Hi,
Actually it is not a problem, due to I'm very new to JQuery/Java I have following question.
Can simple-expand do in such a way that when 1 section 'expanded' all other is 'close/hidden'?
Thanks.
@kbengmy I renamed your issue to better reflect the feature you are requesting.
At this time it's not possible to use simple-expand as an accordion (this seems to be how the people call this behavior).
You can fork the code and make a very simple change at line 218. Just add this line.
$("content").hide();
The reason why this isn't good enough to add to the real source code is that doing so ignores the fact that in advanced scenarios, not all the content element have the same content
css class. A better implementation would be to find each expander on the page and then find their targets and then hide those. It's not terribly hard to do; if you wanna give it a try and send me a PR I'll merge it. Otherwise I might give it a go eventually.
sylvain-hamel,
Appreciate the subject correction and your time for the explanation.
Since you have gave a hint, I will try my best to study your code.
Thanks for the simple and nice code.
This thread can close now. Thanks.
sylvain-hamel,
Added $("content").hide(); to line 218 and it doesn't work as expected.
What I want to achieve with simple-expand is to create a portfolio image listing. Something like GOOGLE image listing.
Hope this is not too much to ask.
@kbengmy I probably did not understand your request then. See this example. I added that line at 218. What is missing?
sylvain-hamel,
Really sorry, I did add the code as you have mentioned.
I have compare the example you gave and the difference I found is the HTML DIVs structure.
The sample result is here, http://oneengine.eu5.org/salamanca-3/#
Thanks for spending the time to explain all this.
Thank you.
NOTE: by the way, how to put sample code here?