简体   繁体   中英

Animated Loading Gif with Jquery?

Is it possible to rotate an image continuously (as in a loading gif) using jQuery? For a static image. Ideally, could it continually turn at 45 degree angle?

There are jQuery libraries that can be used to rotate images, that you can look in to. Have a look at this for instace:

http://code.google.com/p/jqueryrotate/

Found this blog post as well:

http://superdit.com/2011/01/06/rotating-image-using-jquery/

If you have a single image, then you can do that, but only with a browser that can do rotate transforms. No need to go by steps - smooth all the way around.

.rotatable {
    -webkit-animation: Rotate 1s infinite;
}
-webkit-keyframes Rotate {
    from {
        -webkit-transform: rotate(0deg);
    }
    100% {
        -webkit-transform: rotate(360deg);
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM