bootstrap
bootstrap copied to clipboard
use jquery .on to bind javascript component (popover) to element
How do I use Jquery .on to bind a javascript component (eg popover) to an element?
Thank you in advance.
Use the id or class to attach the on function.
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"); });
You could also do this :
$(this).popover("toggle");