This article will explain how to open or active an accordion by URL parameter.
You can keep open/active accordion by URL parameter.
For example, you want to keep active/open 2nd accordion then you can do it by adding URL parameter like this
Single open
http://example.com/accordions/?active_index=83|1
Multiple open
http://example.com/accordions/?active_index=83|1,2-82|1,4
Active index is 1,2 for 83 accordion ID and 1,4 active index for 82 accordion ID.
To enable multiple open, you will need to enable option “Keep expanded others” => “Yes“
- 83, 82 is accordion IDs
- 1,2,3 is active index
- the index start from 0 (zero) refers to the first accordion and so on.
Demo: http://pickplugins.com/demo/accordions/accordions/open-via-url-parameter/?active_index=83|1,2
You can also scroll to the active accordion header by adding #header_id as follows.
http://example.com/accordions/?active_index=83|1#id-1