Anyone know how to start a css3 animation after the rest of the page loads completely (images and everything)?
I am using a delay right now to mimic it but this is not what I'm looking for.
Thanks
Peter
Anyone know how to start a css3 animation after the rest of the page loads completely (images and everything)?
I am using a delay right now to mimic it but this is not what I'm looking for.
Thanks
Peter
$(window).load(function(){...})
works fine!
But use only when you want images to get loaded.
After body load just apply
bodyclass
to the body tag, then all the divs in the page will be animatable. This solution is efficient then @Husar said, because, we need to search only for the body element after the page load is complete but in other case, we need to change all the elements class name that needs to animated.Paste it on the top of your js, and working with function
dom_rdy()
it will calls when dom is ready, without jQuery and others tons of code.That is beyond the scope of CSS, but it is quite simple to do with JQuery
Or read more about it here => http://api.jquery.com/ready/
Place your animation code in a class, lets say .animation
Then call that class on the element you wish to animate using JQuery .addclass() (http://api.jquery.com/addClass/)
Something like this
@Mavericks solution works. But a much simpler solution that worked for me was:
CSS:
JS:
or you can use show/hide. But, animation became buggy on IE10 and IE11. So, I changed the code to specifically for these browsers to:
CSS:
JS:
I also found this: https://css-tricks.com/transitions-only-after-page-load/
Maybe it might help someone.