Skip to content

Instantly share code, notes, and snippets.

@aleszu
Created May 4, 2015 21:29
Show Gist options
  • Save aleszu/fa539979949b0f2c5091 to your computer and use it in GitHub Desktop.
Save aleszu/fa539979949b0f2c5091 to your computer and use it in GitHub Desktop.
Image tooltip
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