June 1, 2013 at 12:24 pm #24173
i use the accordion shortcode to get 5 toggles displayed on one of my pages. Is it possible to hide toggle 2 – 5 if toggle 1 is opened ?
In other words if someone opens one of the 5 toggles i have i would like to hide the rest of the toggles.
Does that make sense ?
Is that may possible ?
SaschaJune 2, 2013 at 11:54 pm #122630
Sort of like a prize drawing whereby as soon as one door is opened , the other doors get disabled? or in this case the toggles that were never opened disappear? It could be done since each individual toggle has its own unique ID, and there is already code that tracks the opening and closing of toggles. Just need to add some jQuery to it that adds a display:none; style to the appropriate div tags. I am not sure something like this is in the scope of the support team’s purpose especially in the light of the time it will take to figure this out and test it. Though I am not sure., see what the others think.
NickJune 3, 2013 at 6:35 pm #122631
Exactly … i have five toggles and i would like to get it working the way that if a customer opens toggle 1 that the rest of the toggles (2-4) get disabled ( a display:none ) if the customer close toggle 1 all toggles get back visible again. If the open toggle 2 than toggle 1,3,4,5 are getting a display none.
Im not that familiar with jquery so i thought to ask you guys ;) i know the the code i need to modify is located in the shortcode.js
I hope you have the time to point me into the right direction. Im sure other people will also benefit from the solution.
Many many thanks
ShortyJune 4, 2013 at 2:56 am #122632
in shortcodes.js find line 308-327
replace it with
if(content.is(':visible')) //if open and gets click
else //if closed and gets click
These are the settings it works with http://www.clipular.com/c?7176314=OpNDsZKo2367by8JWoob5VVDBpc&f=.png
NickJune 4, 2013 at 8:35 am #122633
The topic ‘Hide toggles if a toggle is open.’ is closed to new replies.