Moose
Moose

Reputation: 63

JQuery Tooltip Troubleshooting

First off, I'm new to JQuery, so sorry if this is something simple and I'm just missing it.

I'm attempting to use the jquery plugin called "tooltipsy" (http://tooltipsy.com/).

The end goal is for this look here: http://screencast.com/t/4AghhAI7dL

This is what currently happens: screencast[dot]com/t/mBAIm67lM6W1 (sorry, couldn't post more than two links)

Inside my code I've copied it nearly identically from the examples, but I can't seem to get it to work. This is running inside a twig template file for a WordPress website, but I don't believe that, that should affect it (of course I could be, and probably am wrong)?

<a class="hastip" title="Phone Here">(ES?)</a>
<script type="text/javascript" src=" {{ wp.get_stylesheet_directory_uri()  }}/assets/js/tooltipsy.min.js">
$('.hastip').tooltipsy();
</script>

It links to the CSS file in the header information, and the link works just fine.

My issue is the "tooltip" itself does not appear and I can't figure out why?

Would appreciate any and all help, thanks!

Upvotes: 0

Views: 71

Answers (1)

aze&#243;s
aze&#243;s

Reputation: 4901

<a class="hastip" title="Phone Here">(ES?)</a>
<script type="text/javascript" src=" {{ wp.get_stylesheet_directory_uri()  }}/assets/js/tooltipsy.min.js"></script>
<script>
$(document).ready(function() {
    $('.hastip').tooltipsy();
});
</script>

You can't have code inside a script src.

Upvotes: 1

Related Questions