I have used Jquery UI Tabs, and given close option to the tabs. By default i am creating three tabs and its corresponding three divs. Now when i close a tab then the tab and its div are removed. I need to just hide the tab and div and when i click Add Tab i should just show the hidden tab and div. I am not sure how to show/hide the tab and div property.
Thanks in advance.
Jeevi
disable( href )Returns: jQuery (plugin only) Disables a tab. The selected tab cannot be disabled. The href of the tab to disable.
Tabs are the set of logically grouped content that facilitates users to flip between them. Tabs save the space like accordions. Every tab must use the following set of markups to work properly. Tabs must be in an ordered <ol> or unordered <ul> list.
Based on the discussion at http://old.nabble.com/UI-Tabs:-How-to-hide-show-a-Tab-td19569388s27240.html the following has worked for me -
Adding the following CSS
.ui-tabs .ui-state-disabled {
display: none; /* disabled tabs don't show up */
}
and then using the tabs disabled options in either of the following forms -
$( ".selector" ).tabs({ disabled: [1, 2] }); //when initializing the tabs
$( ".selector" ).tabs( "option", "disabled", [1, 2] ); // or setting after init
see http://jqueryui.com/demos/tabs/#option-disabled for the detailed jQuery docs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With