Jquery Ui Add Class With Animation Does't Work
See my jsfiddle (apologies for putting the javascript into the html body but somehow it did not work placing it in the javascript field): http://jsfiddle.net/40mga4vy/ I want to ch
Solution 1:
You need to define transition rule in CSS. Then background image will change with animation effect:
#wallpaper {
/* ... */transition: all .4s ease;
}
Solution 2:
I have now an animation on image change. I first let the Jquery change the image, then set the opacity to 0 and than with the jquery animate()
I animate the opacity to 1.
I this is you new script:
functionchangeBackground() {
$('#wallpaper').removeClass();
$("#wallpaper").addClass("wallpaper_" + $("#select_category").val()).css('opacity','0').animate({opacity:'1'});
};
Take a look at the fiddle
Post a Comment for "Jquery Ui Add Class With Animation Does't Work"