Created
August 9, 2012 11:31
-
-
Save hitode909/3303455 to your computer and use it in GitHub Desktop.
はてなブログを小刻みに揺らす.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var requestAnimationFrame = (function() { | |
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback, element) { | |
return window.setTimeout(function() { | |
return callback(); | |
}, 1000 / 60); | |
}; | |
})(); | |
var i=0; | |
var $t=$('#container'); | |
var step = function() { | |
$t.css('padding-left', i); | |
i = i == 0 ? 1 : 0; | |
requestAnimationFrame(step); | |
}; | |
requestAnimationFrame(step); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment