show/hide a link if certain jquery ui tab is selected.
- by Mark
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 & 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>