js模拟淘宝
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>案例-模拟淘宝</title>
<style type="text/css">
#showdiv{
width: 1145px;
height: 960px;
border: solid 1px;
border-radius: 20px;
}
#ta{
margin: auto;
margin-top: 10px;
}
</style>
</head>
<body>
<div id="showdiv">
<!--声明js代码域-->
<script type="text/javascript">
function operInImg(img,src){
img.style.border="solid 2px";
var big = document.getElementById("big");
big.src="images/"+src;
}
function operOutImg(img){
img.style.border="";
}
document.write("<table border='0px' width='270px' id='ta'>");
for(var i=0;i<1;i++){
document.write("<tr height='300px'>");
for(var j=0;j<1;j++){
document.write("<td colspan='5'>");
document.write("<img src='images/1561608763147.jpg' width='1116px' id='big'>");
document.write("</td>");
}
document.write("</tr>");
}
for(var i=0;i<1;i++){
document.write("<tr height='60px'>");
for(var j=1;j<6;j++){
document.write("<td>");
document.write("<img src='images/"+j+".jpg' width='220px' height='150px' οnmοuseοver='operInImg(this,"+j+"+\".jpg\")' οnmοuseοut='operOutImg(this)'>");
document.write("</td>");
}
document.write("</tr>");
}
document.write("</table>");
</script>
</div>
</body>
</html>