I'm trying to add this Tooltipster script to my Wordpress site and have an issue with jQuery loading.
The instruction from the site says that this code should be added to the head tag (links to files are already modified for my site):
<link rel="stylesheet" type="text/css" href="http://oopsbox.me/wp-content/uploads/js/tooltipster.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="http://oopsbox.me/wp-content/uploads/js/jquery.tooltipster.min.js"></script>
<script>
$(document).ready(function() {
$('.tooltip').tooltipster();
});
</script>
Then adding a .tooltip class to any element should show a nice tooltip on hover etc.
This works perfectly when i try to do it on a separate page. For example here is my test page.
But when i try to add the same code to Wordpress header.php head tag to display tooltips on my main page the site stops working.
I think it's because of jQuery load line cause Wordpress already has one and uses newer version of jQuery (which Tooltipster should support).
I tried to remove Tooltip jQuery load line and leave only the one Wordpress has by default, but then tooltips don't work.
Could you tell what i'm doing wrong and what are the possible solutions here?
Huge bunch of thanks!
Alex
by the looks of it - it seems that jquery is in noconflict mode.
update your code by adding
jQuery
instead of$