HTML and CSS Reference
In-Depth Information
var hiddenClass = 'hidden';
var activeClass = 't-tab__navitem--active';
$navlinks.click(function() {
// our code for showing or hiding the current
day's line up
$(this.hash).removeClass(hiddenClass);
});
By checking how we have done so far, we notice it keeps each day's line up always
visible and does not hide them once done! Let us add that too, as shown in the fol-
lowing code snippet:
var $navlinks = $('#lineup .js-tabitem');
var $tabs = $('.t-tab__body');
var hiddenClass = 'hidden';
var activeClass = 't-tab__navitem--active';
var $lastactivetab = null;
$navlinks.click(function() {
var $this = $(this);
//take note of what was the immediately
previous tab and tab nav that was active
$lastactivetab = $lastactivetab ||
$tabs.not('.' + hiddenClass);
// our code for showing or hiding the current
day's line up
$lastactivetab.addClass(hiddenClass);
$(this.hash).removeClass(hiddenClass);
$lastactivetab = $(this.hash);
return false;
}
Search WWH ::




Custom Search