0

I am using jquery ui tabs..what i am trying to do is from javascript i am trying to display the second tab after some event from tab1..I am using the following code to change to tab2 which actually is not happening..what ami doing wrong here

jquery:

   $(this.el).find("#ui-id-8").parent(".ui-state-default .ui-corner-top").attr({'tabindex':'0', 'aria-selected':'true'}).addClass("ui-tabs-active ui-state-active").show(); 

html

<div id="tabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
                <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" role="tablist">
                    <li class="ui-state-default ui-corner-top ui-tabs-active ui-state-active" role="tab" tabindex="0" aria-controls="asociateconddiv" aria-labelledby="ui-id-1" aria-selected="true"><a href="#asociateconddiv" class="ui-tabs-anchor" role="presentation" tabindex="-1" id="ui-id-1">Campaign Details</a></li>
                    <li class="ui-state-default ui-corner-top" role="tab" tabindex="-1" aria-controls="createconditiondiv" aria-labelledby="ui-id-2" aria-selected="false"><a href="#createconditiondiv" class="ui-tabs-anchor" role="presentation" tabindex="-1" id="ui-id-2">Scenarios</a></li>
                   <li class="ui-state-default ui-corner-top" role="tab" tabindex="-1" aria-controls="assoctrulegroupdiv" aria-labelledby="ui-id-3" aria-selected="false"><a href="#assoctrulegroupdiv" class="ui-tabs-anchor" role="presentation" tabindex="-1" id="ui-id-3">Confirm &amp; Run</a></li>
               </ul>
1
  • why dont u try this.$("#tabs").tabs("select", "#tabs-" + thisID); here thisID is the ID which ur newly opening the tab having.hopefully this is correct if i understand the question properly Commented Jul 12, 2013 at 14:06

1 Answer 1

1

You can set active tab in jquery ui tabs as below:

$('#tabs').tabs({active: 1});

Active takes value as zero based.

Check demo

Also check detail API documentation

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.