How can I use .append()
with effects like show('slow')
Having effects on append
doesn't seem to work at all, and it give the same result as normal show()
. No transitions, no animations.
How can I append one div to another, and have a slideDown
or show('slow')
effect on it?
It is possible to show smooth if you use Animation. In style just add "animation: show 1s" and the whole appearance discribe in keyframes.
Why don't you simply hide, append, then show, like this:
Having effects on append won't work because the content the browser displays is updated as soon as the div is appended. So, to combine Mark B's and Steerpike's answers:
Style the div you're appending as hidden before you actually append it. You can do it with inline or external CSS script, or just create the div as
Then you can chain effects to your append (demo):
Or (demo):
Set the appended div to be hidden initially through css
visibility:hidden
.The essence is this:
This works for me:
or:
Another way when working with incoming data (like from an ajax call):