How to set the last tab default in jquery Ul tabs? -
unless have specific reasons stick code (which in opinion pretty convoluted) i'd use code that's show on jqueryui homepage. basically, html tabs like
<div id="tabs"> <ul> <li><a href="#tabs-1">t1</a></li> <li><a href="#tabs-2">t2</a></li> <li><a href="#tabs-3">t3</a></li> </ul> <div id="tabs-1"> <p>...</p> </div> <div id="tabs-2"> <p>...</p> </div> <div id="tabs-3"> <p>...</p> </div> </div>
and activating last tabs become simple, see documentation: negative value selects panels going backward last panel.:
$(function() { $( "#tabs" ).tabs( { active: -1 } ); });
you see how little code needed?
Comments
Post a Comment