Expanding a content via an arbitrary link
Besides specifying a particular content be expanded
automatically and by default when the page loads, via the "
true]" setting, you can also do the same on demand using an arbitrary
link, or by passing a parameter string to the current page's URL.
For the former, just call the function:
accordionid" is the ID of the accordion's
main DIV, and
index is the index number of the content within it
you wish to expand (0=1st content, 1=2nd etc). Take a look at the below links
following the accordion:
This accordion content has a custom full width of 350px. Note where the two inline CSS are added within the markup.
Expanding a content by passing a parameter into the URL string
Another way of expanding a content inside your horizontal accordion is by passing in a parameter to the current page's URL specifying the accordion ID and the index of the content to expand. The syntax is:
<a href="targetpage.htm?accordionid=index">A link</a>
where again "
accordionid" is the ID of the accordion's main DIV,
index is the index number of the content within it you wish to
expand (0=1st content, 1=2nd etc). The following links causes different contents
within the horizontal accordion above to expand by default when the page is
<a href="haccordion_suppliment2.htm?hc1=1">Expand 2nd content of horizontal accordion on this page when it loads</a>
Reload the current page and see a different content expanded by clicking on the following two links:
The URL parameter method of content selection always takes precedence over both the persisted content state and default selected content setting within the script.
Table Of Contents
This script consists of an index page plus two supplementary pages: