0
I have a tablist on the page who is responsible for picking up some content through a function
. When that function
does not return any value, the right is to give a hide
in that list
and in your content
. So far everything is working, see the code below:
var explore = $('#tablist-explore');
if ( $.trim($('#tablist-explore ul').html()).length == 0 ){
$('#explore-tablist').hide();
}
This, in this case, is responsible for removing the element if it does not have a child
, but here comes my big doubt...
I have 5 tabs, the first one is the one that owns the class active
by default, but in some parts of the project this first tab
has no content and the next tab
does not take class active
.
Look at the examples of what I’m saying:
- Delete tabs that have no content: http://prntscr.com/95zidn (Here it has 4 of 5 tabs, IE, a part works)
- Deletes tabs, but does not activate the tabs present: http://prntscr.com/95ziy8 (Here it has a single tab, but does not receive the active class)
Summing up: How do I play a class active
within the tab that the content is not 0 or null?
Exactly Fábio, is that for now has not even much to publish, the maximum would be HTML and CSS. I’m more confused when it comes to the logic question when a tablist is removed for lack of content, the code passes an active class and an Aria-Expanded=true for the next active tab. Understands?
– Lucas Henrique