For smart Primates & ROBOTS (oh and ALIENS ).

Blogroll

Saturday, July 05, 2014

Image rotate in jQuery

Image rotate in jQuery


<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
</head>
<body>
<img style="transform: rotate(285.4deg);" id="myimg"  src="WOW.jpg">
<script type="text/javascript">
    jQuery(function($) {
        $(document).ready(function() {
            window.imagerotate = function () {
                $('#myimg').rotate({
                                angle:0,
                                animateTo:-360,
                                callback: imagerotate,
                                //t: current time,b: beginning value,c: change in value,d: duration
                                easing: function (x,t,b,c,d) {
                                    return c*(t/d)+b+10000;
                                }
                            });
                        };
                        setTimeout('imagerotate()', 1000);
                });
});
</script>
</body></html>          
Share:

0 comments:

Post a Comment

Add Dependent Scripts

   here is the code that allow to add dependent script :         <script>         const addDependentScripts = async function( scriptsT...

Ads Inside Post

Powered by Blogger.

Arsip