Note that there are some explanatory texts on larger screens.

plurals
  1. POGet each element with jQuery from handlebars template
    primarykey
    data
    text
    <p>I want to get each item from a template. The template looks like:</p> <pre><code>&lt;div class="row flush" id="photos_list"&gt; &lt;script id="photo_list_template" type="text/x-handlebars-template"&gt; {{#each this}} &lt;div class="3u photo"&gt; &lt;img src="{{url}}" alt="{{name}}"/&gt; &lt;/div&gt; {{/each}} &lt;/script&gt; &lt;/div&gt; </code></pre> <p>And now i want to take each img, and on hover to display the alt, and a black background, but i cannot seem to make it work, to take the element. I want something like:</p> <pre><code>$('div.row').find('img').hover(function(){ //some code }) </code></pre> <p>This is the generated html:</p> <pre><code>&lt;div class="row flush" id="photos_list"&gt; &lt;div class="3u photo"&gt; &lt;img src="http://everythingawesomeever.files.wordpress.com/2013/07/awesome-meter.jpg" alt="Again, with the insanity."&gt; &lt;/div&gt; &lt;div class="3u photo"&gt; &lt;img src="http://who-is-awesome.com/who-is-awesome.jpg" alt="Who's awesome?"&gt; &lt;/div&gt; &lt;div class="3u photo"&gt; &lt;img src="http://www.miataturbo.net/attachments/insert-bs-here-4/78009-my-little-random-picture-thread-*sfw-huffy-*-1682345-slide-slide-1-biz-stone-explains-how-he-turned-91-random-photos-into-movie-jpg?datelin" alt="After Mask"&gt; &lt;/div&gt; &lt;div class="3u photo"&gt; &lt;img src="http://www.miataturbo.net/attachments/insert-bs-here-4/76756-my-little-random-picture-thread-*sfw-huffy-*-11254201pkm5958-jpg?dateline=1368653578" alt="English Muffin"&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>How can i do it?</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. 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