function DrawImage22(ImgD,width,height){ var image=new Image(); image.src=ImgD.src; var swidth=image.width; var sheight=image.height; if(image.width>0 && image.height>0){ flag=true; if(swidth>width){ swidth=width; sheight=(image.height*swidth)/image.width; } image.width=swidth; image.height=sheight; if(sheight>height){ sheight=height; swidth=(image.width*sheight)/image.height; } ImgD.width=swidth; ImgD.height=sheight; ImgD.alt="点击查看大图片"; } } var train_num = 5; if(_g_._get("nnn")) train_num=5; var tp_str="
"; document.write(tp_str); tp_str=""; function getImg(data,width,height){ for(var i=0;i
"+data[i].productname.substr(0,20).replace("+"," ")+"
地区:"+data[i].province+"
"; } } function bindtrainevent(){ $(".ofer_boxbody li div").hover(function(){$(this).removeClass("ofer_classimg").addClass("ofer_classimg2");},function(){$(this).removeClass("ofer_classimg2").addClass("ofer_classimg");}); $("#tijiao").click(function(){ if(!$("#title").attr("value")){alert("请输入标题!");$("#title").focus();return false;} if(!$("#memo").attr("value")){alert("请输入内容!");$("#memo").focus();return false;} if(!$("#name").attr("value")){alert("请输入联系人!");$("#name").focus();return false;} if(!$("#phone").attr("value")){alert("请输入电话!");$("#phone").focus();return false;} if(!$("#email").attr("value")){alert("请输入邮件!");$("#email").focus();return false;} if(!$("#company").attr("value")){alert("请输入公司名称!");$("#company").focus();return false;} if(!$("#address").attr("value")){alert("请输入公司地址!");$("#address").focus();return false;} }); } $.ajax({ url:ajaxurl("apollo","train_getprod_bysortid"), type:"post", dataType:"json", data:{act:'getproduct',sortid:'3061',area:'411902',prodid:'15817064',v:Math.random()}, success:function(data, textStatus){ if(data.ok=='1'){ var info = data.info; if(info.length){ getImg(info,220,220); $("#showtrain_body").html(tp_str); bindtrainevent(); } } }, error:function(XMLHttpRequest, textStatus, errorThrown){ //alert("操作失败,请重试!"); } });