Accordion – Auto Show

  • Posted in : Responsy WP
  • philipjamesbarnes
    Participant

    Hi Guys,

    On the accordion shortcode, how can I say show first pane automatically?

    I’ve tried current=”true” and current=”yes” as well as selected=”yes”

    ahmetsali
    Keymaster

    Hi, paste the code below to the “External Stylesheet/JavaScript” box under “Style tab” ;

    <script>
    $(function() { $('.accordion-group:first .accordion-toggle').trigger('click'); });
    </script>
    
    
    philipjamesbarnes
    Participant

    Hi Ahmet,

    This doesn’t work for me.

    Any ideas why not? I did as you said, but it’s had no impact.

    Phil

    philipjamesbarnes
    Participant

    Hello – any ideas on this for me?

    I want to keep the first pane of accordion open, but the standard shortcode doesn’t let me?

    Phil

    philipjamesbarnes
    Participant

    Guys any ideas on this? One of the last things I’m looking for. Have one accordion pane open initially

    ahmetsali
    Keymaster

    Hi, i just tested the code and it works fine on my side.

    – Please make sure: you paste the code to the “External Stylesheet/JavaScript” box under “Style tab” , not “Custom CSS” box.

    philipjamesbarnes
    Participant

    Hi Ahmet,

    This is working for me now (must have been the update).

    However, to throw spanner in the works, I’ve a page where I do want accordion to show first pane, and another where I don’t. Am I out of luck?

    I thought you could manipulate the short code with something like this – current=”true” or current=”yes” or selected=”yes”

    Phil

    ahmetsali
    Keymaster

    Hi, i see, good point, added to update list, thanks for the feedback

    JaakkoMedia
    Participant

    Hi,

    Is it possible to show the first pane of only the second accordion (“Standaard”) on http://www.videobird.nl/tarieven/?

    Thanks,
    Jaakko

    ahmetsali
    Keymaster

    @JaakkoMedia

    try adding this to External JS box

    jQuery(document).ready(function($) {  
       $('.span4:nth-child(2) .accordion-group:first-child').addClass('active').find('.accordion-body').show();
    });
    
    JaakkoMedia
    Participant

    Awesome, it works!

    Thnx ahmetsali!

Viewing 11 posts - 1 through 11 (of 11 total)

The forum ‘Responsy WP’ is closed to new topics and replies.