Skip to content

Instantly share code, notes, and snippets.

@furf
Created April 4, 2009 15:21
Show Gist options
  • Save furf/90234 to your computer and use it in GitHub Desktop.
Save furf/90234 to your computer and use it in GitHub Desktop.
/**
* jQuery hoverClass plugin
*/
$.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