Skip to content

Instantly share code, notes, and snippets.

@pranaygp
Created June 25, 2013 07:52
Show Gist options
  • Save pranaygp/5856735 to your computer and use it in GitHub Desktop.
Save pranaygp/5856735 to your computer and use it in GitHub Desktop.
Simple function that changes css property on mouse enter, and reverts back to the original on mouse leave... REQUIRES jQuery Usage: $('selector').CSShover('property','value') Example: $('#link').CSShover('color','#ff0000')
(function(a){jQuery.fn.CSShover=function(d,c){var b;this.hover(function(){b=a(this).css(d);a(this).css(d,c);},function(){a(this).css(d,b);});};})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment