$("#userShopCar").mouseover(function (){//根据id实现鼠标悬浮触发事件mouseCar
$.post('pages/back/shopCar/showMyCar',{},function (res){
let car = $("#mouseCar");//获取想重写的div父类
car.empty();//清空div子类元素
let data = res.data;//循环 获得每组元素for(let x =0;x<data.length;x++){
let g = data[x];
let mouseCarDiv = $("<!--购物车鼠标悬停下拉菜单-->\n"+"\t\t\t\t\t\t\t\t\t\t<ol class=\"mini-products-list\">\n"+"\t\t\t\t\t\t\t\t\t\t\t<li>\n"+"\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"product-image\" href=\"product-details.html\">\n"+"\t\t\t\t\t\t\t\t\t\t\t\t\t<img src=\"../../../../path"+g.goods.img+"\" </a>\n"+"\t\t\t\t\t\t\t\t\t\t\t\t</a>\n"+"\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"product-details\">\n"+"\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"cartproduct-name\">\n"+"\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"product-details.html\">"+g.goods.title+"</a>\n"+"\t\t\t\t\t\t\t\t\t\t\t\t\t</p>\n"+"\t\t\t\t\t\t\t\t\t\t\t\t\t<strong class=\"qty\">数量:"+g.count+"</strong>\n"+"\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"sig-price\">价格:"+g.goods.price+"</span>\n"+"\t\t\t\t\t\t\t\t\t\t\t\t</div>\n"+"\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"pro-action\">\n"+"\t\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"btn-remove\" href=\"#\">remove</a>\n"+"\t\t\t\t\t\t\t\t\t\t\t\t</div>\n"+"\t\t\t\t\t\t\t\t\t\t\t</li>\n"+"\t\t\t\t\t\t\t\t\t\t</ol>\n"+"\t\t\t\t\t\t\t\t\t\t</div>")
car.append(mouseCarDiv);}})})