Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1184805
    katyzwiers
    Participant

    Hi there, a while ago you showed me how to link to a page with an accordion that would open up a specific box on the accordian. It worked lovely for ages but has recently stopped, could you let me know why? I’ve tried a few things myself but can’t get it to work…

    https://community.theme.co/forums/topic/link-to-an-accordion-on-another-page-which-opens-up-an-accordion-item/

    Thanks!

    Katy

    #1184909
    Rupok
    Member

    Hi Katy,

    Thanks for writing in! It should not stop be itself. It seems you have updated Cornerstone but using older version of X. Let’s try to update X to latest version and check again. Make sure the code is there where it supposed to be.

    Cheers!

    #1190608
    katyzwiers
    Participant

    Thanks for that Rupok. I updated X, which hasn’t solved the problem. I’ve also double checked the code is still the same in the custom javascript box in CUSTOMISE, which it is:

    jQuery ( function ( $ ) {

    var hash = window.location.href.split(‘#’)[1];

    if ( hash !== undefined && $(‘.page-id-458 a[href^=”#collapse”]’).length > 0 ) {

    $(document).ready ( function() {

    $( ‘a[href^=”#’ + hash + ‘”]’ ).trigger(‘click’);

    } );

    }

    } );

    I’ve also checked the page ID hasn’t changed, and that I’m still using the same link: This

    Any other ideas of how to fix this?

    Thanks,

    Katy

    #1190610
    katyzwiers
    Participant

    (a href=”http://isthisit.uk/glossary/#collapse-1&#8243;) is the link code I’m using, if I put <> and it creates an actual link!

    #1190718
    Paul R
    Moderator

    Hi,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #1190733
    katyzwiers
    Participant
    This reply has been marked as private.
    #1190780
    Paul R
    Moderator

    Hi Katy,

    I changed the js code to this.

    
    jQuery ( function ( $ ) {
    
    var hash = window.location.href.split('#')[1];
      console.log(hash);
    if ( hash !== undefined && $('.page-id-458 #'+ hash).length > 0 ) {
        $(document).ready ( function() {
            console.log('test');
            $( '#'+hash + ' a.x-accordion-toggle' ).trigger('click');
        } );
    }
    } );
    

    Please add id to each accordion item.

    http://screencast.com/t/zrtj8UQ3

    I have added an id to the first three to test

    http://isthisit.uk/glossary/#test-1
    http://isthisit.uk/glossary/#test-2
    http://isthisit.uk/glossary/#test-3

    Feel free to change the id name

    Thanks

    #1190826
    katyzwiers
    Participant

    Fab, thank you!!

    Katy

    #1190917
    Rahul
    Moderator

    You’re most welcome, Katy!

    Let us know if we can help with anything else.

  • <script> jQuery(function($){ $("#no-reply-1184805 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>