Simple Tabbing System


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $('.ukn-mod-tabs').each(function(i, el) {
  2. //if ($(el).children().length > 1) {
  3. $(el).children().each(function(j, el1) {
  4. $(el1).attr('id', 'n-'+i+'-'+j);
  5. $(el1).parent().after('<a href="#n-'+i+'-'+j+'">'+j+'</a>');
  6. });
  7. $(el).children().not(':first').hide();
  8. $(el).parent().find('> a').click(function(e) {
  9. e.preventDefault();
  10. $(this).addClass('ukn-active').siblings().removeClass('ukn-active');
  11. var tabSelected = $(this).attr('href');
  12. $(el).children().not('.ukn-mod-tabs-nav').hide().parent().find(tabSelected).show();
  13. }).wrapAll('<div class="ukn-mod-tabs-nav" />').first().addClass('ukn-active');
  14. //}
  15. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.