Skip to content

Instantly share code, notes, and snippets.

@ehrenmurdick
Created February 2, 2010 22:03
Show Gist options
  • Save ehrenmurdick/293095 to your computer and use it in GitHub Desktop.
Save ehrenmurdick/293095 to your computer and use it in GitHub Desktop.
$.fn.confusicate = function() {
$(this).each(function() {
var elem = $(this);
elem.mouseover(function() {
setInterval(function() {
elem.css({position: 'relative'});
elem.animate({top: (Math.random() * 100) - 50 + 'px', left: ((Math.random() * 100) - 50) + 'px'}, 100);
elem.animate({fontSize: (Math.random() * 5) - 2.5 + 'em'}, 80);
}, Math.random() * 100 + 200);
});
});
}
$(function() {
setTimeout(function() { $('a, img, :input').confusicate() }, 3000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment