Skip to content

Instantly share code, notes, and snippets.

@jensechu
Created October 26, 2009 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jensechu/218972 to your computer and use it in GitHub Desktop.
Save jensechu/218972 to your computer and use it in GitHub Desktop.
$(".fish").draggable({
drag: function() {
$("#picture img").attr({ src: "images/kitty_hungry.png" });
revert: true;
},
stop: function () {
if($("#picture img").hasClass("eating")) {
setTimeout(reset_kitty, 2000);
}
else {
reset_kitty();
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment