1 回答
TA贡献1795条经验 获得超7个赞
不晓得是不是这样的效果。
<body>
<div class="main">
<section class="image-text">
<div class="say-lis-image-text"></div>
<div class="say-lis-new-title"></div>
<div class="content">
<p></p>
<div class="img"></div>
</div>
</section>
</div>
</body>
<script>
var html='';
var $main = $(".main");
for (var i in data) {
html += '<section class="image-text">';
html += ' <div class="say-lis-image-text"><div class="title"><h3>'+data[i].content+'</h3></div></div>';
html += ' <div class="say-lis-new-title"><a href="#"><img src='+data[i].doctorAddress+'></a><span class="doc-name">'+data[i].doctorName+'</span></div>';
html += ' <div class="content">';
html += ' <p>'+data[i].content+'</p>';
html += ' <div class="img">';
//图片
var imgs = data[i].img;
for (var j in imgs){
html += '<div class="imgbox">'+ imgs[j].imgAddress+'</div>';
}
html += ' </div>';
html += ' </div>';
html += '</section>';
}
$main.html(html);
</script>
添加回答
举报