jquery - Nested Each Criteria -
i have following timer periodically updates page:
var refreshid = setinterval(function() {     $(".content").each(function(i) {         // stuff         $(this).each(function(i) {           // issue here         });     }); }, 10000);   within nested foreach loop, extract images, essentially, want match > .icons > .img, images inside of div of class "icons".
the markup section following:
       <div class="content">             <div></div>             <div class="icons">                 <img id="dynamicimage12345" src="#">             </div>         </div>   how can accomplish this?
you need line there:
$("div.icons > .img", $(this)).each(function() {     // code images });   it assumed using img class images can seen code. if not using class, can try instead:
$("div.icons > img", $(this)).each(function() {     // code images });   so becomes:
var refreshid = setinterval(function() {   $(".content").each(function(i) {     // stuff     $("div.icons > img", $(this)).each(function() {       // code images     });   }); }, 10000);      
Comments
Post a Comment