i everyone,
i have a problem that has already happened to me in another case, but I present this hoping that we can solve it:
The jquery (called on "rendered") works well when it is not generated by eachloop ... why not work in generated html?
i click on an image generated by eachloop and nothing happens
gallery.html
{{#each gallery}} <div class="superbox-list"> <img src="images/superbox/superbox-thumb-1.jpg" data-img="images/superbox/superbox-full-1.jpg" alt="My first photoshop layer mask on a high end PSD template theme" title="Miller Cine" class="superbox-img"> </div> {{/each}} <div class="superbox-list"> <img src="images/superbox/superbox-thumb-1.jpg" data-img="images/superbox/superbox-full-1.jpg" alt="My first photoshop layer mask on a high end PSD template theme" title="Miller Cine" class="superbox-img"> </div> <div class="superbox-list"> <img src="images/superbox/superbox-thumb-2.jpg" data-img="images/superbox/superbox-full-2.jpg" alt="My first photoshop layer mask on a high end PSD template theme" title="Bridge of Edgen" class="superbox-img"> </div>
gallery.js
Template.gallery.rendered = function(){ $('.superbox').SuperBox(); } Template.gallery.helpers({ gallery: function(){ return Gallery.find(); } });
best regards, ty
EDIT:
I used this way and it worked, although not find the method defer in meteor docs!
_.defer(function () { $('.superbox').SuperBox(); });