Created
July 10, 2018 23:34
-
-
Save spigotdesign/f35d82c38b980aff8f0325ba7861ede5 to your computer and use it in GitHub Desktop.
Hide title attribute on hover, but don't remove
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
$(".element").hover(function(){ | |
// Get the current title | |
var title = $(this).attr("title"); | |
// Store it in a temporary attribute | |
$(this).attr("tmp_title", title); | |
// Set the title to nothing so we don't see the tooltips | |
$(this).attr("title",""); | |
}); | |
$(".element").click(function(){// Fired when we leave the element | |
// Retrieve the title from the temporary attribute | |
var title = $(this).attr("tmp_title"); | |
// Return the title to what it was | |
$(this).attr("title", title); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment