/ Published in: jQuery
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$('.ukn-mod-tabs').each(function(i, el) { //if ($(el).children().length > 1) { $(el).children().each(function(j, el1) { $(el1).attr('id', 'n-'+i+'-'+j); $(el1).parent().after('<a href="#n-'+i+'-'+j+'">'+j+'</a>'); }); $(el).children().not(':first').hide(); $(el).parent().find('> a').click(function(e) { e.preventDefault(); $(this).addClass('ukn-active').siblings().removeClass('ukn-active'); var tabSelected = $(this).attr('href'); $(el).children().not('.ukn-mod-tabs-nav').hide().parent().find(tabSelected).show(); }).wrapAll('<div class="ukn-mod-tabs-nav" />').first().addClass('ukn-active'); //} });