show/hide a link if certain jquery ui tab is selected.

Posted by Mark on Stack Overflow See other posts from Stack Overflow or by Mark
Published on 2010-05-10T16:13:35Z Indexed on 2010/05/10 16:34 UTC
Read the original article Hit count: 375

When #my-text-link is clicked, i need to select tab 5 and when tab 5 is selected i need to hide #my-text-link. hope this makes sense, heres the code, and also what I have done so far, please feel free to show me a better way. Thanks in advance

    var $tabs = $('.tabbed').tabs(); // first tab selected
        $('#my-text-link').click(function() { // bind click event to link
            $tabs.tabs('select', 4); // switch to third tab
            $('#my-text-link').hide();
            return false;
        });


<a href="#" id="my-text-link"></a>

<ul>
<li class="one"><a href="#tabs-1" title="Summary"></a></li>
<li class="two"><a href="#tabs-2" title="Detailed Info"></a></li>
<li class="three"><a href="#tabs-3" title="Images"></a></li>
<li class="four"><a href="#tabs-4" title="Reviews"></a></li>
<li class="five"><a href="#tabs-5" title="Dates &amp; Prices"></a></li>
</ul>

<div id="tabs-1"></div>
<div id="tabs-2"></div>
<div id="tabs-3"></div>
<div id="tabs-4"></div>
<div id="tabs-5"></div>

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-ui