JQuery accordion extension

Let's say you have 5 "accordions" (i.e. 5 expandable / compressible sections). Is it possible to provide for one of these sections to expand when the page loads?

+3
source share
3 answers

Addition required: true.

Code examples Initialize an accordion with the active option.

$( ".selector" ).accordion({ active: 2 });

Get or set the active option after init. // getter

var active = $( ".selector" ).accordion( "option", "active" );

//setter

  $( ".selector" ).accordion( "option", "active", 2 );

Hope this helps. You can check out http://jqueryui.com/demos/accordion/

+4
source

$( ".selector" ).accordion({ active: 2 });

if you don't specify the option explicitly, it will be the first child here by default   - this is a demo, maybe this will help

+1
source

yes there is an active property to define an extended default partition

you can see it here active

+1
source

Source: https://habr.com/ru/post/1793801/


All Articles