I am trying to make the images fade out using css3 after loading them. The problem is how my methods are currently chained, it fades twice and breaks for two seconds. instead of just being empty and fading.
My solution was to try to split the animation code into a separate class, which I apply AFTER I initially set the opacity to zero (I do this in JS so that people not including js can still see the images).
It still doesn't work though
I suppose, because in this code it sets the opacity to zero and immediately adds an animation transition class that somehow catches the opacity.css () method while it is still changing (I don't know how this is possible ... shouldnt it be fully opaque before moving on to adding a class?)
// nice thumbnail loading $('.thumb').css('opacity','0').addClass('thumb-animated').on('load', function(){ $(this).css('opacity','1'); }); .resources .thumb-animated { -webkit-transition: opacity .2s; -moz-transition: opacity .2s; -ms-transition: opacity .2s; -o-transition: opacity .2s; transition: opacity .2s; }
source share