Posted By

davebowker on 02/02/11


Tagged

jquery tabs


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

virendrakryadav


Simple Tabbing System


 / Published in: jQuery
 

  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  

You need to login to post a comment.