Skip to content

Instantly share code, notes, and snippets.

@objectivehtml
Forked from qbmarketing/gist:2490769
Created April 25, 2012 17:03
Show Gist options
  • Save objectivehtml/2491327 to your computer and use it in GitHub Desktop.
Save objectivehtml/2491327 to your computer and use it in GitHub Desktop.
JS for qtip
<a href="#your-tooltip-id" class="definition">Show Tooltip</a>
<div class="ui-tooltip" id="your-tooltip-id">
<p>Some content goes here</p>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('a.definition').qtip({
content: {
text: function(api) {
var id = $(this).attr('href');
return $(id).html();
}
},
position: {
my: 'bottom center',
at: 'top center'
},
style: {
classes: 'ui-tooltip-youtube ui-tooltip-shadow'
}
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment