jq动态添加轮播图图片

jq动态添加轮播图图片
在这里插入图片描述

var asd = [
    {imge:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.win4000.com%2Fwallpaper%2Ff%2F54a0f7661aa7c.jpg&refer=http%3A%2F%2Fpic1.win4000.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1617328872&t=d3853e754b132d5a9b3150b9aa87ee3b'},
    {imge:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg02.tooopen.com%2Fimages%2F20150411%2Ftooopen_sy_117920898363.jpg&refer=http%3A%2F%2Fimg02.tooopen.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1617328872&t=e4592ad521ee75401709bb65ab75f954'},
    {imge:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.win4000.com%2Fwallpaper%2Ff%2F54a0f7661aa7c.jpg&refer=http%3A%2F%2Fpic1.win4000.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1617328872&t=d3853e754b132d5a9b3150b9aa87ee3b'},
]
 var ul=$('ul');
var fileList = ''
asd.forEach(item=>{
            console.log(item);
            var as = item.imge
            console.log(as);
            fileList +='<li><img src="'+as+'"></img></li>'
})
console.log(fileList);
ul.append(fileList)

效果
在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值