<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" type="text/css" href="css/list1.css">
</head>
<body>
<div>
<div id="main-hover">
<div class="sHoverItem">
<img src="images/spp.jpg">
<span class="sIntro">
<h2 id="goodId1">外套长裙1</h2>
<p>莺卡 两生花印花棉麻假两件外套,简单的花色,充满了夏日里的清新感</p>
<i>¥</i><h3>29.9</h3>
<button>加入购物车</button>
</span>
</div>
</div>
</div>
<form><input type="button" id="btn" value="加载更多"/></form>
<script src="js/ajax.js"></script>
<script src="js/jquery-1.11.3.js"></script>
<script>
var oBtn=document.getElementById("btn")
oBtn.onclick=function(){
ajax("json.json",function(date){
var oDate=JSON.parse(date);
console.log(oDate)
var str="";
var oDiv=$("#main-hover")
for(var i=0;i<oDate.length;i++)
{
str+='<div class="sHoverItem">'+
'<img src=" '+oDate[i].src+' ">'+
'<span class="sIntro">'+
'<h2 id="goodId2">'+oDate[i].name+'</h2>'+
'<p>'+oDate[i].bewrite+'</p>'+
'<i>¥</i><h3>'+oDate[i].price+'</h3>'+
'<button>加入购物车</button>'+
'</span>'+
'</div>'
}
oDiv.append(str);
},function(){alert(0)})
}
</script>
<!--js效果-->
<script src='js/sHover.js'></script>
<script src='js/fun.js'></script>
</body>
</html>
Summy_qiang
紫焰123
相关分类