开发者

hyperlink to jquery tabs

开发者 https://www.devze.com 2023-02-17 15:08 出处:网络
We have our accordion tabs ( horizontal as follows ) <ul class=\"tabs\"> <li><a href=\"#tab1\"><span class=\"upArrow\">Inbox (2)</span></a></li>

We have our accordion tabs ( horizontal as follows )

<ul class="tabs"> 
    <li><a href="#tab1"><span class="upArrow">Inbox (2)</span></a></li> 
    <li><a href="#tab2"><span class="downArrow">Sent (8)</span></a></li>
    <li><a href="#tab3"><span class="composeMssg">Compose</span></a></li>
    </ul> 

We have the tab titles as such

<div class="tab_content_container"> 

    <div id="tab1" class="tab_content" style="font-size: 12px;"> 

Content and then closing divs, and remainder of tabs linking to the href's as you do.

Issue is ,

How can I link to 开发者_如何学C#tab2 from external link and open that tab on page load.


Say you want to select a particular tab via an external link, then you need to do..

$("#tabs").tabs("select", "#tabid");

So, for selecting tab2 on page load..

$(function(){
    $("#tabs").tabs("select", "#tab2");
});


Put this in a script tag in the body tag of your html.

$("#tab2").hide()
$("#tab3").hide()
$("#tab1").show()
0

精彩评论

暂无评论...
验证码 换一张
取 消