Linking to a section of an Accordion from another page

后端 未结 4 2058
借酒劲吻你
借酒劲吻你 2020-12-14 17:51

I\'m using twitter-Bootstrap 2.04, and I\'m using the latest jQuery. I\'m trying to make a link that will go from one page to the page containing this accordion, and then ac

4条回答
  •  旧巷少年郎
    2020-12-14 18:24

    Yes, you will need to manually activate it on page load. Something like the following should work:

    $(document).ready(function () {
      location.hash && $(location.hash + '.collapse').collapse('show');
    });
    

    Also, as @SaadImran pointed out, this assumes that you link to the collapsible element id (eg., #collapseTwo) rather than the name in the anchor (eg., #Alink2).

提交回复
热议问题