Link to open jQuery Accordion

前端 未结 7 2328
臣服心动
臣服心动 2020-12-03 12:16

I\'m trying to open an accordion div from an external link. I see the \"navigation: true\" option but I\'m not sure how to implement it. Do you give each div an id and call

7条回答
  •  猫巷女王i
    2020-12-03 12:24

    The navigation option isn't for panel activation. It's for telling the user where they are.

    Using simplified html code:

    Services

    More information about all of these services

    About

    About us

    You put the unique ID in the Hyperlink in the title

    Then the jQuery (simplified):

    
    

    The "navigation : true" will enable you to go www.site.com/#about which makes the "about" panel selected. For activation, there are a couple of ways. Perhaps one way is to grab a query string and put it into the jQuery.

    With C#

    $("#accordion").accordion("activate", '<%= Request.QueryString["id"] %>');
    

    With PHP

    $("#accordion").accordion("activate", '');
    

    Which will allow you to specify which panel to open by www.site.com?id=2

提交回复
热议问题