开发者

Jquery tabs initial tab selection

I've implemented jquery tabs and want to call the page they are on in two ways. Firstly with the first tab open and the others hidden which works fine. But secondly I want tab 4 to be visible when landing on the page. So I have simply duplicated the page - Page A opens with the first tab in view. Page B has this code....

<script type="text/javascript">
    $(function() {
      $("#tabs").tabs();
    });
</script> 
<script type="text/javascript"> 
    $(function() { 
      $("#tabs").tabs( 'select' , 3 ) 
    }); 
</scr开发者_开发知识库ipt>

and opens the forth tab. BUT it opens the first tab first then flashes to tab 4.

How can I get the page to open tab 4 initially without opening the first tab first. Hope you can follow my ramble!!!

Nick


There does not appear to be an obvious solution. One suggestion I have seen is to use jQuery to keep the tabs hidden until they have loaded and then show them after the selection has taken place.


That would be how to open to the 4th tab using their API.

Perhaps you can try hiding the tab div, creating it, and then showing it in the show event when the 4th tab is shown (which will happen after everything is initialized).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜