Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- $(document).ready(function () {
- var grad = $('.p_border_r').css('background');
- var deg = 45;
- var lastms = 0;
- var animate = true;
- var callback = function (time) {
- if (lastms == 0) {
- lastms = time;
- }
- deg = (deg + (time - lastms) * 0.3);
- lastms = time;
- while (deg > 360) {
- deg -= 360;
- }
- var newCss = grad.replace('45deg', deg + 'deg');
- $('.p_border_r').css('background', newCss);
- if (animate) {
- window.requestAnimationFrame(callback);
- } else {
- lastms = 0;
- }
- };
- window.requestAnimationFrame(callback);
- })
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement