2

I'm building a website and I want to implement a CSS loading animation in it.

(such as this one: http://codepen.io/hone/pen/Hhjuk)

Whatever animation I choose to use, it'll be one that consistently plays until the rest of the page loads.

How do I get the animation to begin playing once it loads and continue playing until the rest of the page loads?

I've researched this but I can only find tips on how to make a specific element fade in and out until the page loads.

3
  • I don't know how to do this either, but my guess would be that the solution does not involve only CSS. You probably also need to make use of JavaScript in some way. Commented Jun 26, 2014 at 4:59
  • you can use jPreLoader plugin. Commented Jun 26, 2014 at 5:02
  • designhuntr.com/… Commented Jun 26, 2014 at 5:04

2 Answers 2

3

Here is the page load library you can use.

PACE JS

This provides a many built in solutions , but you can customize it.

Here is demo how i used it before

Sign up to request clarification or add additional context in comments.

2 Comments

That didn't quite work right. Especially since I can't even read the script it's so condensed.
do you want css code, or a javascript that allows you to target page load event?
0

use animation-iteration-count: infinite; to make an animation loop forever.

See my example here: http://codepen.io/MatthewBryce/pen/reaJjO

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.