Phillip Chan
Phillip Chan

Reputation: 993

How to get jquery Tooltipster Plugin to work for newly created DOM elements?

I'm using the Tooltipster plugin http://calebjacob.com/tooltipster/ which is great but I have dynamically generated content that's being inserted into the DOM. It doesn't seem like tooltipster is detecting those as it's being set to trigger on Document Ready.

I know this is a bit of an esoteric plugin but any ideas on how to get the plugin to work for newly created elements in the DOM?

Thanks

Upvotes: 5

Views: 1374

Answers (3)

user254153
user254153

Reputation: 1883

I think it would be accomplished if you write you plugin load code after the DOM has finished loading. You may write inside:

$(window).load(function()

});

As this executes after all DOM has finished loading.

Upvotes: 0

RustyDrill
RustyDrill

Reputation: 31

Try this one

$(document).on('mouseover', '.ololo', function(event) { $(this).tooltipster({multiple:true}); });

Upvotes: 3

Linto
Linto

Reputation: 1282

Just add the instantiation script in the ajax content too.

Also set the option "multiple:true"

Its worked for me

Upvotes: 0

Related Questions