I have a navigation tabs and when user clicks a tab the div changes with ajax. I would like to it to remember on what tab user was when user changes page. I havent done the tab navigation and im totally new to javascript/jquery. Here is the javascript for the tabs:
jQuery('#contentContainer #tabNavi .nav-item').each(function(i, item) {
jQuery(item).bind('click', function() {
if (jQuery('a', this).hasClass('activeTab')) {
return;
} else {
jQuery('#contentContainer #tabNavi .nav-item' a').removeClass('activeTab').eq(i).addClass('activeTab');
channel_id = jQuery('a', this).attr('href').split('#')[1];
if (channel_id == _channel) {
return;
}
}
})
});
The nav links are like this:
<li><a href="#39">Link1</a></li>
<li><a href="#53">Link2</a></li
Now I have the href value saved in a cookie but i dont know how can i change the active class to right li item when user comes on page and he has been on site before and he has clicked some tab.