User:Luke Rusowicz-Orazem/common.js: Difference between revisions

Jump to navigation Jump to search
(Created page with "$.fn.animateRotate = function (angle, duration, complete) { return this.each(function () { var $elem = $(this); $({ deg : 0 }).animate...")
 
(Blanked the page)
 
Line 1: Line 1:
$.fn.animateRotate = function (angle, duration, complete) {
    return this.each(function () {
        var $elem = $(this);


        $({
            deg : 0
        }).animate({
            deg : angle
        }, {
            duration : duration,
            step : function (now) {
                $elem.css({
                    transform : 'rotate(' + now + 'deg)'
                });
            },
            complete : complete || $.noop
        });
    });
};
$('#content').animateRotate(360, 5000, function () {
    });

Latest revision as of 19:32, 8 November 2016