Private: Home › Forums › HTML Templates › Mixed Modern and Professional HTML Template › Vertical Tab combinded with horizontal tab › Reply To: Vertical Tab combinded with horizontal tab
February 28, 2015 at 5:28 pm
#2318
Participant
Hello,
I see the problem now.
Could you try using the following jQuery code?
$('.tabs').each(function () {
var $tabLis = $(this).find('li.active');
var $tabContent = $(this).next('.tab-content-wrap').find('.tab-content');
$tabContent.hide();
$tabLis.first().addClass('active').show();
$tabContent.first().show();
});
$('.tabs').on('click', 'li', function (e) {
var $this = $(this);
var parentUL = $this.parent();
var tabContent = parentUL.next('.tab-content-wrap');
parentUL.children().removeClass('active');
$this.addClass('active');
tabContent.find('.tab-content').hide();
var showById = $this.find('a').attr('href');
var activeChild = $(showById).find('li.active a').attr('href');
$(showById).find(activeChild).show();
tabContent.find(showById).fadeIn();
e.preventDefault();
});
The tabs should display the appropriate tab content now.
Let me know if it works well for you.
Robert