jQuery how to set first tab active? -


 $( '#xxx' ).tabs({ select: function(event, ui) {  var theselectedtab2 = ui.index;  if (theselectedtab2  == 0) { $('ul li.ep_s1').removeclass('ep_s1').addclass('ep_s-click1'); if ($('ul li#h13').hasclass('ep_l-click1')) {    $('ul li#h13').removeclass('ep_l-click1').addclass('ep_l1'); }} else if (theselectedtab2  == 1 ) { $('ul li.ep_l1').removeclass('ep_l1').addclass('ep_l-click1'); if ($('ul li#h12').hasclass('ep_sidebar_friends-click1')) {    $('ul li#h12').removeclass('ep_s-click1').addclass('ep_s1'); }}  } });  

if use selected: 0 set first tab active go through if (theselectedtab2 == 0) statement , go through adding classes.

if after page loads click on tabs script works perfect.

basically want when page loads if (theselectedtab2 == 0) statement , happens inside active.

thanks

trigger click event on first tab after page load?

like $('first tab selector').click()


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -