I am looking to incorporate a transition on my div when it is clicked. I've tried using jQuery with this example: http://jsfiddle.net/nKtC6/698/, but it seems to not be working as expected. So, I want to explore another example using CSS: http://jsfiddle.net/nKtC6/690/
Here is the issue in my JS:
$(function() {
$("#icon").click(function() {
$("animate1").removeClass("animate1-nomove").addClass("animate1-move");
$("animate2").removeClass("animate2-nomove").addClass("animate2-move");
});
});
And here is the CSS:
.animate1-nomove {left: -100px;}
.animate2-nomove {left: 0px;}
.animate1-move {left: 0px;}
.animate2-move {left: 150px; background-color: red;}
Is it possible to achieve this effect using JavaScript? I prefer a CSS3 solution over jQuery animate for this.