You can validate that using a jQuery selector to check if it's open or not.
Meaning, if for instance the only think that changes is the css attribute display, you can get the display value and if is display:none if should be closed.
Here's an example:
if ( $('<your element or css class>').css('display') == 'none' ) ---> The element is closed, else is open.
If you're using the Accordion given ny the SilkUI, the only difference is that a class called expanded is added to the element. So for this scenario you can use a selector like:
if ( $('<your element or css class>' ).hasClass( 'expanded' ) ) ---> The element is open, else is closed.
According to the value, you can do what you need/want.
Hope it helps.
Thanks for the info - I will try that next time. As it turns out, I already changed the Accordion widget to instead use the SectionExpandable and then updated the CSS to move the carrot to the let so it looks like an Accordion.
So, next time I have an Accordion I will give this a try thanks!
Could I use this to add aria tags aria-expanded="true" and aria-expanded="false" to the accordion somehow?
Gonçalo Martins wrote:
Keith Matthews wrote: