4

I'm trying to make a accordion faq page on mobile but it should be open by default? It's working when i use this line of code $( "#accordion" ).accordion( "activate" ); is there a counter part for it? I would like to use data-mage-init instead.

1 Answer 1

0

You can use mention the active tabs by "active": [0,1,2],

For example

<div id="element" data-mage-init='data-mage-init='{"accordion":{"openedState": "active", "collapsible": true, "active": [0,1,2], "multipleCollapsible": true}}'>
4
  • I just need to open/active all the accordion by the default when the pages load mate sorry if my question is a bit confusing. data-mage-init='{"accordion":{"openedState": "active", "collapsible": true, "active": [0,2], "multipleCollapsible": true}}' here is my code by the way Feb 27, 2017 at 13:56
  • You can use Active element number data-mage-init='{"accordion":{"openedState": "active", "collapsible": true, "active": [0,1,2], "multipleCollapsible": true}}' Feb 27, 2017 at 14:14
  • i really want to but i still need to have at least 15 reputation :( Feb 27, 2017 at 14:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.