Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can supply an event delegation target selector pointing to an element which might or might not exist using the <code>selector</code> option.</p> <pre><code>$('body').popover({ html: true, content: function () { return $(this).next().text(); }, selector: '.has-popover' }); </code></pre> <p>EDIT:</p> <p>See this <a href="http://jsfiddle.net/SchmalzyB/pq59j/4/" rel="nofollow">jsFiddle Demo</a> and maybe this will make more sense. Notice how when a new row is added, it still gets a popup because I have added the <code>selector: '.has-popover'</code> option set. This will add a popover to any element with the <code>.has-popover</code> class, whenever the element is created.</p> <p>You can add custom content by dynamically loading the <code>content</code> option as shown above and in my demo. Basically, what this is doing is taking the current element that the popover is being created for <code>$(this)</code> then traversing to the "next" element <code>.next()</code> then grabbing its text <code>.text()</code>. </p> <p>ANOTHER EDIT:</p> <p>I just found <a href="http://jsfiddle.net/KPeKS/4/" rel="nofollow">This jsFiddle Demo</a> which describes this better than I can....</p> <blockquote> <p>The 'selector' option essentially allows you to run tooltips and popovers using jQuery's 'on' function, which means that you can allow dynamically added HTML with the correct selectors to trigger popups as if they were present in the originally loaded DOM. Without the selector option, only elements present in the initial DOM will trigger tooltips; any that are dynamically added will not.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload