I am working on a project which is having jquery driven menus.but it is not working-
the code is
$(function(){
$('a#home').click(function(b){
b.preventDefault();
$.cookie('class','home');
});
$('a#write').click(function(c){
c.preventDefault();
$.cookie('class','write');
});
$('a#comments').click(function(d){
d.preventDefault();
$.cookie('class','comments');
});
$('a#medias').click(function(e){
e.preventDefault();
$.cookie('class','medias');
});
$('a#users').click(function(f){
f.preventDefault();
$.cookie('class','users');
});
$('a#stats').click(function(g){
g.preventDefault();
$.cookie('class','stats');
});
$('a#settings').click(function(h){
h.preventDefault();
$.cookie('class','settings');
});
$('a#backup').click(function(i){
i.preventDefault();
$.cookie('class','backup');
});
var class=$.cookie('class');
switch($.cookie('class')) {
case 'home': $('#hom').show();
$('#writ').hide();
$('#comment').hide();
$('#media').hide();
$('#user').hide();
$('#stat').hide();
$('#setting').hide();
$('#backu').hide();
$('li#home').removeClass('home current');
$('li#write').removeClass('home current');
$('li#comments').removeClass('home current');
$('li#medias').removeClass('home current');
$('li#users').removeClass('home current');
$('li#stats').removeClass('home current');
$('li#settings').removeClass('home current');
$('li#backup').removeClass('home current');
$('li#home').removeClass('home');
$('li#write').addClass('write');
$('li#comments').addClass('comments');
$('li#medias').addClass('medias');
$('li#users').addClass('users');
$('li#stats').addClass('stats');
$('li#settings').addClass('settings');
$('li#backup').addClass('backup');
$('li#home').removeClass('home');
$('li#home').addClass('home current');
break;
case 'write': $('#hom').hide();
$('#writ').show();
$('#comment').hide();
$('#media').hide();
$('#user').hide();
$('#stat').hide();
$('#setting').hide();
$('#backu').hide();
$('li#home').removeClass('home current');
$('li#write').removeClass('home current');
$('li#comments').removeClass('home current');
$('li#medias').removeClass('home current');
$('li#users').removeClass('home current');
$('li#stats').removeClass('home current');
$('li#settings').removeClass('home current');
$('li#backup').removeClass('home current');
$('li#home').addClass('home');
$('li#write').removeClass('write');
$('li#comments').addClass('comments');
$('li#medias').addClass('medias');
$('li#users').addClass('users');
$('li#stats').addClass('stats');
$('li#settings').addClass('settings');
$('li#backup').addClass('backup');
$('li#write').removeClass('write');
$('li#write').addClass('write current');
break;
case'comment': $('#hom').hide();
$('#writ').hide();
$('#comment').show();
$('#media').hide();
$('#user').hide();
$('#stat').hide();
$('#setting').hide();
$('#backu').hide();
$('li#home').removeClass('home current');
$('li#write').removeClass('home current');
$('li#comments').removeClass('home current');
$('li#medias').removeClass('home current');
$('li#users').removeClass('home current');
$('li#stats').removeClass('home current');
$('li#settings').removeClass('home current');
$('li#backup').removeClass('home current');
$('li#home').addClass('home');
$('li#write').addClass('write');
$('li#comments').removeClass('comments');
$('li#medias').addClass('medias');
$('li#users').addClass('users');
$('li#stats').addClass('stats');
$('li#settings').addClass('settings');
$('li#backup').addClass('backup');
$('li#comments').removeClass('comments');
$('li#comments').addClass('comments current');
break;
case'users': $('#hom').hide();
$('#writ').hide();
$('#comment').hide();
$('#media').show();
$('#user').hide();
$('#stat').hide();
$('#setting').hide();
$('#backu').hide();
$('li#home').removeClass('home current');
$('li#write').removeClass('home current');
$('li#comments').removeClass('home current');
$('li#medias').removeClass('home current');
$('li#users').removeClass('home current');
$('li#stats').removeClass('home current');
$('li#settings').removeClass('home current');
$('li#backup').removeClass('home current');
$('li#home').addClass('home');
$('li#write').addClass('write');
$('li#comments').addClass('comments');
$('li#medias').removeClass('medias');
$('li#users').addClass('users');
$('li#stats').addClass('stats');
$('li#settings').addClass('settings');
$('li#backup').addClass('backup');
$('li#medias').removeClass('medias');
$('li#medias').addClass('medias current');
break;
case'medias':$('#hom').hide();
$('#writ').hide();
$('#comment').hide();
$('#media').hide();
$('#user').show();
$('#stat').hide();
$('#setting').hide();
$('#backu').hide();
$('li#home').removeClass('home current');
$('li#write').removeClass('home current');
$('li#comments').removeClass('home current');
$('li#medias').removeClass('home current');
$('li#users').removeClass('home current');
$('li#stats').removeClass('home current');
$('li#settings').removeClass('home current');
$('li#backup').removeClass('home current');
$('li#home').addClass('home');
$('li#write').addClass('write');
$('li#comments').addClass('comments');
$('li#medias').addClass('medias');
$('li#users').removeClass('users');
$('li#stats').addClass('stats');
$('li#settings').addClass('settings');
$('li#backup').addClass('backup');
$('li#users').removeClass('users');
$('li#users').addClass('users current');
break;
case'stats':$('#hom').hide();
$('#writ').hide();
$('#comment').hide();
$('#media').hide();
$('#user').hide();
$('#stat').show();
$('#setting').hide();
$('#backu').hide();
$('li#home').removeClass('home current');
$('li#write').removeClass('home current');
$('li#comments').removeClass('home current');
$('li#medias').removeClass('home current');
$('li#users').removeClass('home current');
$('li#stats').removeClass('home current');
$('li#settings').removeClass('home current');
$('li#backup').removeClass('home current');
$('li#home').addClass('home');
$('li#write').addClass('write');
$('li#comments').addClass('comments');
$('li#medias').addClass('medias');
$('li#users').addClass('users');
$('li#stats').removeClass('stats');
$('li#settings').addClass('settings');
$('li#backup').addClass('backup');
$('li#stats').removeClass('stats');
$('li#stats').addClass('stats current');
break;
case'settings':$('#hom').hide();
$('#writ').hide();
$('#comment').hide();
$('#media').hide();
$('#user').hide();
$('#stat').hide();
$('#setting').show();
$('#backu').hide();
$('li#home').removeClass('home current');
$('li#write').removeClass('home current');
$('li#comments').removeClass('home current');
$('li#medias').removeClass('home current');
$('li#users').removeClass('home current');
$('li#stats').removeClass('home current');
$('li#settings').removeClass('home current');
$('li#backup').removeClass('home current');
$('li#home').addClass('home');
$('li#write').addClass('write');
$('li#comments').addClass('comments');
$('li#medias').addClass('medias');
$('li#users').addClass('users');
$('li#stats').addClass('stats');
$('li#settings').removeClass('settings');
$('li#backup').addClass('backup');
$('li#settings').removeClass('settings');
$('li#settings').addClass('settings current');
break;
case'backup':$('#hom').hide();
$('#writ').hide();
$('#comment').hide();
$('#media').hide();
$('#user').hide();
$('#stat').hide();
$('#setting').hide();
$('#backu').show();
$('li#home').removeClass('home current');
$('li#write').removeClass('home current');
$('li#comments').removeClass('home current');
$('li#medias').removeClass('home current');
$('li#users').removeClass('home current');
$('li#stats').removeClass('home current');
$('li#settings').removeClass('home current');
$('li#backup').removeClass('home current');
$('li#home').addClass('home');
$('li#write').addClass('write');
$('li#comments').addClass('comments');
$('li#medias').addClass('medias');
$('li#users').addClass('users');
$('li#stats').addClass('stats');
$('li#settings').addClass('settings');
$('li#backup').removeClass('backup');
$('li#backup').removeClass('buckup');
$('li#backup').addClass('backup current');
break;
default:$('#hom').show();
$('#writ').hide();
$('#comment').hide();
$('#media').hide();
$('#user').hide();
$('#stat').hide();
$('#setting').hide();
$('#backu').hide();
$('li#home').removeClass('home');
$('li#home').addClass('home current');
}
});