I'm Trying to zoom a picture in fullscreen (later on!). Why is the container css attribute margin-left not changed within the callback function? (Scroll down please ;)
<!DOCTYPE html>
<html>
<head>
<title>Zoom Hover</title>
<style type="text/css">
#container{
margin-left:200px;
}
@-moz-keyframes zoom {
0%{
height:200px;
width:200px;
}
100% {
width: 1000px;
height: 1000px;
-moz-transform: translate(-200px);
}
}
@-webkit-keyframes 'zoom' {
0%{
height:200px;
width:200px;
}
100% {
width: 1000px;
height: 1000px;
left:0px;
-webkit-transform: translate(-200px);
}
}
.img1 {
width:200px;
height:200px;
}
.img2 {
-moz-animation: zoom 4s;
-webkit-animation: 'zoom' 4s;
}
</style>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('img').click(function() {
$("#container img").addClass("img2").removeClass("img1",function(){
$("#container").css("margin-left","0px");});}); /*HERE WHY IS IT NOT CHANGING MARGIN-LEFT??*/
});
</script>
</head>
<body>
<div id="container">
<img class="img1" src="http://www.maplehilltree.com/CHRIST_PUNCHERS_HOOO__6_.jpg"/>
</div>
</body>
</html>