Skip to content

Instantly share code, notes, and snippets.

@WagnerMoreira
Created April 25, 2014 13:07
Show Gist options
  • Save WagnerMoreira/11288979 to your computer and use it in GitHub Desktop.
Save WagnerMoreira/11288979 to your computer and use it in GitHub Desktop.
Hide Alt/Tittle from images
(function($){
$.fn.hideTips = function(){
return this.each(function(){
var $elem = $(this)
var savealt = $elem.attr('alt');
var savetitle = $elem.attr('title');
$elem.hover(function(){
$elem.removeAttr('title').removeAttr('alt');
},function(){
$elem.attr({title:savetitle,alt:savealt});
});
});
};
})(jQuery);
$(function(){
$('.img').hideTips();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment