I have two standard jQueryUI tabs looking pretty much the same.
For the comfort, they have the cookie option added. But now when I change page from one tab to another, the same tab-index will be selected on the other page, because of the cookie.
Is it possible to assign a cookie-id to the tab function or anything alike?
The html:
<div id='tabs' class='ui-tabs'>
<ul class='ui-tabs-nav'>
<li><a href='link'>Item</a></li>
<li><a href='link'>Item</a></li>
<li><a href='link'>Item</a></li>
<li><a href='link'>Item</a></li>
<li><a href='link'>Item</a></li>
</ul>
</div>
And the jQuery:
$(function() {
$('#tabs').tabs({
cookie: {expires: 1},
spinner: '<img src=\'img/icons/loading.gif\' />',
load: function (e, ui) { $(ui.panel).find('.tab-loading').remove(); },
select: function (e, ui) {
var $panel = $(ui.panel);
if ($panel.is(':empty')) {
$panel.append('<div class=\'tab-loading\' style=\'text-align: center; font-weight: bold; width: 100%\'>Loading...</div>')
}
}
})
});
You can do it with name 🙂