How do I open a tab from with jQuery UI Tabs from an link outside of the div?

后端 未结 7 1084
清酒与你
清酒与你 2021-01-02 01:09

This may be a little difficult to explain, but I\'ll try my best. I have a product page with two tabs, full description and video. These are done using jQuery UI Tabs.

7条回答
  •  执笔经年
    2021-01-02 02:00

    For jQuery UI 1.11

    HTML:

    ...
    ... Open Video Tab

    JS:

    $('.open-tab').click(function () {
      $("#tabs").tabs('option','active',$('#tabs a.ui-tabs-anchor[href="'+$(this).attr('href')+'"]').index('#tabs a.ui-tabs-anchor'));
    });
    

提交回复
热议问题