So I have these CSS3 script
#place.us .level1 { background-position: -100px; background-color: #333; }
#place.gb .level1 { background-position: -100px; background-color: #CCC; }
@-webkit-keyframes place-pop-livel1 {
0% { bottom: -100px; }
100% { bottom: 30px; }
}
#place .level1 {
animation: place-pop-livel1 2s ease-out;
-moz-animation: place-pop-livel1 2s ease-out;
-webkit-animation: place-pop-livel1 2s ease-out;
}
When the page loads first, the div has #place.us, and the animation works fine. Now I want to change the div class to "gb" to make it #place.gbusing jquery, and as soon as the class changes, I want the same animation to happen.
My jquery code is simple
$('.change-city').live('click', function(){
var city = $(this).data('city');
$('#place').removeClass().addClass(city);
});
The class and property are changed .level1as specified in the CSS, but the animation is not executed. How can I make sure the animation is happening?
source
share