开发者

Looping div from parent div using JQuery

开发者 https://www.devze.com 2023-04-11 16:21 出处:网络
guys.. I just wanna loop my div from return json result....as you can see here\'s the desire result I\'m after

guys..

I just wanna loop my div from return json result....as you can see here's the desire result I'm after

<div id="doaimgbox"><!-- parent div -->

  <!-- start looping portion -->
  <!-- I wanna loop this div based on length json return result let's say 3 --&g开发者_开发知识库t;

    <div class="imgdiv">

        <img src="imagedoa/d0.jpg" width="400" height="150" />
        <div id="rbox">
            Was sent <span class="counter"></span> times.
            <br/>
            <br/>
            <br/>
            <span class="buttonshare"><a href="">Click to select</a></span>
        </div>
    </div>
<!-- looping portion -->

as you can see below here are my attempt but no to avail..

$.ajax({type :'GET',
    url : 'getallimg.php',
    dataType : 'json',
    success : function(data){
      $.each(data, function(i,item){
        $("#loader").hide(500);
        $("<div class='imgdiv'><img src='imagedoa/"+item.imgname+".jpg' width='450' height='150' /></div></br>")
        .appendTo("#doaimgbox");
       });

Really need help ..suggest me the best solution or suggestion..tq

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号