• Resolved nappysoft

    (@nappysoft)


    Hello,

    I’d like to directly open a accordion title by a link.

    Lets say I have 10 titles on one FAQ page.
    I’d like to send a Link to a Customer, so that the title 3rd accordion is opend and the others are collapsed.

    Can anyone tell me how this is possible?

    Kind regards

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @nappysoft

    This feature is not available in the free version, If You want to use this feature you have to buy the pro version of the accordion.

    Thank you

    bytefabriek

    (@bytefabriek)

    I just bought the pro version, but it does NOT support this functionality. You’ll have to add a script yourself, something like this: https://github.com/elementor/elementor/issues/2993

    bytefabriek

    (@bytefabriek)

    This works with the pro and the free version if you link to an accordion page with the id of the block to collapse in the url (www.yoursite.com/page#collapse_id)

    setTimeout(function(){
    var current = window.location.href;
    var current = current.split(‘#’);
    if(current[1].length>1) {
    var hash = ‘#’+current[1];
    jQuery(‘.wpsm_panel-title a[href=”‘+hash+'”]’).removeClass(‘collapsed’);
    jQuery(hash).addClass(‘in’);
    jQuery(hash).show();
    }
    }, 200);

    preetam27

    (@preetam27)

    hi @bytefabriek ,

    thanks for the suggetion we will try it and test with our plugin..if it compataible with that we will update it soon.

    thanks

    Hi @bytefabriek ,

    I’ve added your code as an html block above the accordions, but it’s not working. Is there something I’m doing wrong?

    <script type="text/javascript">
         jQuery(document).ready(function($){
              setTimeout(function(){
              var current = window.location.href;
              var current = current.split(‘#’);
              if(current[1].length>1) {
              var hash = ‘#’+current[1];
              jQuery(‘.wpsm_panel-title a[href=”‘+hash+'”]’).removeClass(‘collapsed’);
              jQuery(hash).addClass(‘in’);
              jQuery(hash).show();
              }
              }, 200);
         })
    </script>
    • This reply was modified 3 years, 8 months ago by saharzez.

    Hi Saharzez,

    I’m using a slightly modified version now:

    <script type=”text/javascript”>
    jQuery(document).ready(function(){
    setTimeout(function(){
    var location = window.location.href;
    var split_location = location.split(‘#’);
    if(split_location[1] == ‘undefined’){
    } else if(split_location[1].length>1) {
    var hash = ‘#’+split_location[1];
    jQuery(‘.wpsm_panel-title a[href=”‘+hash+'”]’).removeClass(‘collapsed’);
    jQuery(hash).addClass(‘in’);
    jQuery(hash).show();
    window.scrollBy(0, -200);
    }
    }, 200);
    })
    </script>

    You can see it in action here: https://www.shb-online.nl/information-literacy-en/subject-matter/metaliteracy-en/#ac_3360_collapse4

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Link to directly open accordion title’ is closed to new replies.