Salve a tutti, ho un problema con questo codice. Cliccando il div dovrebbe transitare a sinistra, cambiando la classe del body, ma non so perchè non succede nulla. Potreste aiutarmi?
--------------------------------------------------
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>
function cambia (c){
var classe = 'left';
if ( c = 'left') {
classe = 'home';
}
$('body').removeClass(classe);
$('body').addClass(c);
});
</script>
<style type="text/css">
div {
width: 100%;
height:100%;
-webkit-transition: left .7s ease;
position: fixed;
top: 0;
}
.home .uno {
left: 0%;
background-color: #98d925;
}
.home .due {
left: 100%;
background-color: #ff5c00;
}
.left .uno {
left: -100%;
background-color: #98d925;
}
.left .due {
left: 0%;
background-color: #ff5c00;
}
</style>
</head>
<body class="home">
<div class="uno" onclick="cambia('left')">
</div>
<div class="due" onclick="cambia('home')">
</div>
</body>
</html>