Created
January 20, 2011 21:23
-
-
Save craigmccoy/788708 to your computer and use it in GitHub Desktop.
suppressing browser tooltips, usage example: http://jsbin.com/eliro3/11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$.fn.suppressTooltips = function() { | |
return this.each(function() { | |
var elem = $(this); | |
var title = elem.attr('title'); | |
var alt = elem.attr('alt'); | |
elem.hover(function() { | |
elem.attr('title', '').removeAttr('alt'); | |
}, function() { | |
elem.attr({ title: title, alt: alt }); | |
}); | |
}); | |
}; | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment