I have a tablist on the page that is responsible for picking up some content through a function
. When this function
returns no value, the right thing is to give hide
to this list
and its content
. Until then everything is working, see the code below:
var explore = $('#tablist-explore');
if ( $.trim($('#tablist-explore ul').html()).length == 0 ){
$('#explore-tablist').hide();
}
This, in case, is responsible for removing the element, if it does not have a child
, but here comes my great doubt ...
I have 5 tabs, the first one is the one with class active
by default, but in some parts of the project this first tab
has no content and the next tab
does not take the active
class.
Look at the examples of what I'm saying:
- Delete tabs that do not have content: link (Here it has 4 of 5 tabs, ie one part works)
- Delete the tabs but not activate the one that is present: link (Here it has a single tab, but does not receive the active class )
In short, how do I play a active
class inside the tab that the content is not 0 or null?