var img1_src = "http://img.diytrade.com/cdimg/1435839/23294093/0/1315969316.jpg";
var img2_src = "http://img.diytrade.com/cdimg/1435839/23294098/0/1315969333.jpg";
var img3_src = "";
var img4_src = "";
var img5_src = "";
var img1_normal_code = "";
var img2_normal_code = "";
var img3_normal_code = "";
var img4_normal_code = "";
var img5_normal_code = "";
var prodImg_img1_code = img1_normal_code;
var prodImg_img2_code = img2_normal_code;
var prodImg_img3_code = img3_normal_code;
var prodImg_img4_code = img4_normal_code;
var prodImg_img5_code = img5_normal_code;
var prodImg_img1_src = img1_src;
var prodImg_img2_src = img2_src;
var prodImg_img3_src = img3_src;
var prodImg_img4_src = img4_src;
var prodImg_img5_src = img5_src;
function changeImage(imgID){
var oImgPos = document.getElementById("image_normal_id");
oImgPos.href = eval(imgID + "_src");
oImgPos.innerHTML = eval(imgID + "_normal_code");
for (var j=1;j<=5;j++) {
if (document.getElementById("prodImg_img" + j)!=null) {
document.getElementById("prodImg_img" + j).className="imgBorder";
}
}
document.getElementById("prodImg_" + imgID).className="imgBorderH";
return false;
}
$(function() {
$("#prodImg_img1,#prodImg_img2,#prodImg_img3,#prodImg_img4,#prodImg_img5").click(function(){
$("#prodImg_img1,#prodImg_img2,#prodImg_img3,#prodImg_img4,#prodImg_img5").removeAttr("class");
$("#prodImg_img1,#prodImg_img2,#prodImg_img3,#prodImg_img4,#prodImg_img5").attr("class","imgBorderBlur");
$(this).removeAttr("class");
$(this).attr("class","imgBorderH");
$("#image_normal_id").html(eval($(this).attr("id")+"_code"));
$("#image_normal_id").attr("href",eval($(this).attr("id")+"_src"));
})
});
|
选择图片 |
|
| |