Skip to content

Instantly share code, notes, and snippets.

@craigmccoy
Created January 20, 2011 21:23
Show Gist options
  • Save craigmccoy/788708 to your computer and use it in GitHub Desktop.
Save craigmccoy/788708 to your computer and use it in GitHub Desktop.
suppressing browser tooltips, usage example: http://jsbin.com/eliro3/11
(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