I have two tabs on top of my website named Business and Personal. When the page loads for the first time the items of the Business tab are shown in the bar below to the tabs.By clicking on the Perosnal it shows the personal items. This is working fine for me. Now I want to change something in the code, when I click on any Personal Menu Items the page refreshes, and it again shows the Business menu items. Look at the website here
Here is my Jquery code :
$(document).ready(function() {
$('.business-tab').show();
$('.personal-tab').hide();
$('.business-tab #block-nice_menus-2').hide();
$('.business-top').children().css('color','#00A2C8');
$('.personal-top').children().css('color','#000000');
$('.business-top').click(function(e) {
e.preventDefault();
$(this).children().css('color','#00A2C8');
$('.personal-top a').css('color', '#000000');
$(this).css('margin-bottom', '0px');
$('.personal-tab').hide();
$('.business-tab').show();
$('.business-tab #block-nice_menus-2').hide();
});
$('.personal-top').click(function(e) {
e.preventDefault();
$(this).children().css('color','#00A2C8');
$('.business-top a').css('color', '#000000');
$(this).css('margin-bottom', '0px');
$('.personal-tab').show();
$('.business-tab').hide();
$('.personal-tab #block-nice_menus-2').show();
$('.personal-tab #block-nice_menus-1').hide();
});
});
I know when the page refreshes it execute the code which I written in document ready. When I click on any item under the Personal Menu, after the page refresh it goes again to the Business Menu and its items. I don't want that instead of it I want personal items to be shown. How can I do this ? Your help is really appreciated.