-1

there are two links sign-in and register on page top. In page body there are two tabs sign-in and register. When clicked on sign-in it should display sign-in tab and when clicked on register it should display register tab. Both the tabs are present inside seperate div and there is a parent div for these two div's. Currently I am using the following code which displays only first tab on the click of both links:

    $("ul#myaccount-details-tabs").tabs("div#myaccount-details-panes>div");
        $(".tabs").each(function(){
        initTabs($(this).attr("id"));
    });

Html code is as follows:

     <div id="signin-info-tab-container" >
          <ul id="myaccount-details-tabs">
               <li><a href="#">sign-in</a></li>
              <li ><a href="#">create an account</a></li>
          </ul>
          <div id="myaccount-details-panes">
                 <div id="signin-details-panes">


                </div><!-- signin-details-panes-->
                <div id="register-details-panes">

                </div><!--register-details-panes-->
           </div><!--myaccount-detailes-panes-->
     </div><!--signin-info-tab-container-->

Now, I have to display register tab instead of sig-in tab on the click of register link present on the page top.

Abhijeet F
  • 1
  • 1
  • 2

1 Answers1

1

Tyr this:

$('#tabs').tabs();

$('#sign-in').click(function(){    
    $("#tabs").tabs("select", "#tabs-1");        
});

$('#register').click(function(){    
    $("#tabs").tabs("select", "#tabs-2");        
});

DEMO HERE

palaѕн
  • 72,112
  • 17
  • 116
  • 136
  • Thanks for the suggestion. As it did not work Please go through the html code structure which i have updated and suggest the solution. – Abhijeet F Nov 30 '12 at 10:12
  • @AbhijeetF: I updated the code with your html. It's working for me. Please confirm. http://jsfiddle.net/nSLfN/20/ – palaѕн Nov 30 '12 at 10:45