Skip to content

Instantly share code, notes, and snippets.

View tsmd's full-sized avatar

Shimada Takayuki tsmd

View GitHub Profile
@tsmd
tsmd / jquery.haneru.js
Created January 10, 2013 04:03
$('#hoge').haneru('+=200', '+=100', 100, 500)
$.fn.haneru = function (x, y, takasa, duration) {
var self = this;
return self.queue(function () {
var offset = self.offset();
var step = function (now, fx) {
if (fx.prop !== 'y') return;
self.css({
left:fx.elem.x,
top:fx.elem.y - Math.sin(Math.PI * fx.pos) * takasa
});