jquery accessor id vs class? -
at link: http://jqueryui.com/demos/tabs/ when "view source", have:
<div id="tabs"> <ul> <li><a href="#tabs-1">...</a></li> <li><a href="#tabs-2">...</a></li> <li><a href="#tabs-3">...</a></li> </ul> <div id="tabs-1">...</div> <div id="tabs-2">...</div> <div id="tabs-3">...</div> </div>
so want know, how implement class instead of id,
considering portion of code used multiple times may loaded ajax,
in different times.
for dynamically adding tabs, there add method auto-name tab controls you, letting re-use tab creation code repeatedly.
when tab added page, fires add event, shown in tabs doc page:
var $tabs = $('#example').tabs({ add: function(event, ui) { $tabs.tabs('select', '#' + ui.panel.id); } });
Comments
Post a Comment