Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>EDIT</strong></p> <p>I looked at this in more detail, and the problem is that you are passing content to the Bootstrap popover.</p> <p>This html content contains an ID (e.g. <code>#hidden_div_1</code>), but the problem is that any content you pass to the Bootstrap popover <em>gets replicated in that popover</em>.</p> <p>In other words, you end up with duplicate IDs and JQuery does not know what element you are trying to reference.</p> <p>So the solution is to put the data information into the container div (in this case <code>link-container</code>), like so:</p> <pre><code>&lt;div class="link-container" data-rating="1" data-price="10"&gt; &lt;a href="#" data-title="Title 1" id="r1"&gt;Click Here&lt;/a&gt; &lt;div class="temp-popover-content hidden"&gt; &lt;p&gt; Click on following images&lt;/p&gt; &lt;div class="ratings"&gt;&lt;/div&gt; &lt;p&gt;Some content 1&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>And then you can store data against this link-container without confusing JQuery, like so:</p> <pre><code>$('.link-container a').popover({ content : function() { return $(this).siblings('.temp-popover-content').html(); }, trigger: 'click', html: true }).click(function(e) { // Added this because popovers get confused when more than one with a raty is open $('.link-container a').not(this).popover('hide'); // storage refers to the link-container div var storage = $(this).parent(); $('.ratings').raty({ score: function() { return storage.data('rating'); }, click: function(score, evt, data) { storage.data('rating', score); console.log("Data: "+storage.data('rating')); } }); }); </code></pre> <p><a href="http://jsfiddle.net/mccannf/Qf5uU/11/" rel="nofollow">Fiddle is here</a>.</p>
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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