User:Ammu Susheela/common.js: Difference between revisions

Jump to navigation Jump to search
No edit summary
(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
        });
    });
};
if (getCookie("butterbarHide") != "1") {
    $('#content').animateRotate(1080, 5000, function () {
    });
    }
    setCookie("butterbarHide", "1", 365);
    function setCookie(cname, cvalue, exdays) {
        var d = new Date();
        d.setTime(d.getTime() + (exdays * 60 * 1000));
        var expires = "expires=" + d.toUTCString();
        document.cookie = cname + "=" + cvalue + "; " + expires;
    }
    function getCookie(cname) {
        var name = cname + "=";
        var ca = document.cookie.split(';');
        for (var i = 0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0) == ' ')
                c = c.substring(1);
            if (c.indexOf(name) != -1)
                return c.substring(name.length, c.length);
        }
        return "";
    }

Revision as of 19:38, 18 September 2015