I have a site, with infinite pages, and dynamically loaded content.
Currently I am using jQuery tipsy plugin, and need to call it in any function that dynamically adds content to the site (to get tooltips to this new content). I am currently in the process of changing my binds to ons, which will help achieve this where click and other events are concerned.
My current code, that is repeated a lot is:
$("[data-tooltip]").tipsy({settings here});
Is it possible to use the jQuery ON, and bind this to the body, and if content is added to the body the content (if it has [data-tooltip] attribute) will automatically execute the tipsy function on?
Eg:
$("body").on("something","[data-tooltip]", function (e) {
$("[data-tooltip]").tipsy({settings here});
});
Thanks