开发者

hyperlink to jquery tabs

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜