is possible to add callback into prepend method? I need to wait until DOM is rebuild and then start fade animation.
$("body").prepend(div);
$(div).css({
'opacity': 1
});
The animation is made with CSS3 transitions, so I only need to wait for DOM ready and then change the CSS opacity..
Here is fiddle with my problem...
is possible to add callback into prepend method? I need to wait until DOM is rebuild and then start fade animation.
$("body").prepend(div);
$(div).css({
'opacity': 1
});
The animation is made with CSS3 transitions, so I only need to wait for DOM ready and then change the CSS opacity..
Here is fiddle with my problem...
Share Improve this question edited Sep 6, 2011 at 13:52 simekadam asked Sep 6, 2011 at 12:56 simekadamsimekadam 7,38411 gold badges59 silver badges80 bronze badges2 Answers
Reset to default 1Here's an update: http://jsfiddle/8MFJQ/4/
prepend doesn't have a callback because the DOM is ready with the call. I'm using Jquery's fadeIn and fadeOut as well to achieve wider browser coverage.
If I'm not wrong you can do it like that $("body").append(div).css({'opacity': 1});
. Or maybe you've to change the method for, like this $(div).appendTo('body').css({'opacity': 1});