Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tipsy jquery plugin for dynamic live events is not working

I'm using the tipsy jquery plugin to create tooltips for dynamically appearing elements.

The tooltips work on non-dynamic elements, so I've definitely included everything that I need. I'm using jquery 1.5.1

This is my jquery code: $('.voted-user-image').tipsy({gravity:'s', live: true});

This is the html of an image link element that appears dynamically in a div after a link is clicked that triggers an AJAX request:

<a href="/profiles/2" class="voted-user-image" title="Test">
    <img alt="Justin meltzer" src="/system/photos/2/tiny/Justin Meltzer.jpeg?1306836552">
</a>`

How can I get this tooltip plugin to work?

like image 422
Justin Meltzer Avatar asked Oct 22 '11 06:10

Justin Meltzer


1 Answers

Can you try this code:

$('a.voted-user-image').tipsy({live: true});

Seems so wrong calling plugin each time you add content :)

like image 139
Haris Krajina Avatar answered Nov 15 '22 02:11

Haris Krajina