bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

use jquery .on to bind javascript component (popover) to element

Open edwinmugendi opened this issue 13 years ago • 3 comments

How do I use Jquery .on to bind a javascript component (eg popover) to an element?

Thank you in advance.

edwinmugendi avatar Dec 31 '12 08:12 edwinmugendi

Use the id or class to attach the on function.

emman-bautista avatar Dec 31 '12 08:12 emman-bautista

I found this $("div#details_post_mylistings_view").popover({ selector:"span.post-details-popover-help" }).on("mouseenter mouseleave","span.post-details-popover-help", function(ev) { $(this).popover("mouseenter" === ev.type ? "show": "hide"); });

edwinmugendi avatar Dec 31 '12 09:12 edwinmugendi

You could also do this :

$(this).popover("toggle");

MGaetan89 avatar Dec 31 '12 11:12 MGaetan89