Skip to content

Instantly share code, notes, and snippets.

@hitode909
Created August 9, 2012 11:31
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hitode909/3303455 to your computer and use it in GitHub Desktop.
Save hitode909/3303455 to your computer and use it in GitHub Desktop.
はてなブログを小刻みに揺らす.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