Created
May 4, 2015 21:29
-
-
Save aleszu/fa539979949b0f2c5091 to your computer and use it in GitHub Desktop.
Image tooltip
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
jQuery(document).ready(function($) { | |
$( document ).tooltip({ | |
items: "[data-tooltip]", | |
content: function() { | |
var element = $( this ); | |
var text = element.text(); | |
var url = element.attr('data-tooltip'); | |
return "<img class='map' alt='" + text + | |
"' src='" + url + "'>"; | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment