Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
はてなブログを小刻みに揺らす.js
(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