Reputation: 2577
I am using jquery-ui to implement tabs.
However, I need to use it more than one on the same page.
but jquery uses the id "tabs" (as opposed to class or something), so it only works for the first instance.
Upvotes: 2
Views: 3244
Reputation: 11
$(document).ready(function()
$("#tabs1, #tabs2").tabs();
});
It works perfect! You can add the tabs you want.
$( "#tabs, #tabs1, #tabs2" ).tabs();
Thank you very much user3152277!
Upvotes: 0
Reputation: 21
Another way is:
$(document).ready(function() {
$("#tabs1").tabs();
$("#tabs2").tabs();
});
Upvotes: 2
Reputation: 11
maybe not the best way, but I worked for two tabs
$(function(){
var options = {
event:'mouseover',
selected:0
};
$("#tabs").tabs(options);
});
<div id="tabs">.....</div>
$(function(){
var options = {
event:'mouseover',
selected:0
};
$(".tabs").tabs(options);
});
<div class="tabs">.....</div>
Upvotes: 1
Reputation: 490597
Could you change the tabs prefix?
$( ".selector" ).tabs({ idPrefix: 'ui-tabs-primary' });
Other than that, it seemed to work for me out of the box.
Upvotes: 3