Skip to content

Instantly share code, notes, and snippets.

@furf
Created March 12, 2010 04:28
Show Gist options
  • Save furf/330031 to your computer and use it in GitHub Desktop.
Save furf/330031 to your computer and use it in GitHub Desktop.
$.fn.hoverClass = function(className) {
return this.each(function() {
var $this = $(this);
$this.hover(function() {
$this.addClass(className);
}, function() {
$this.removeClass(className);
});
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment