我正在尝试使用它,以便如果您选择 id 为“defaultone”或“defaulttwo”的图像之一,则 id 为“actualone”的图像将更改为该图像。我知道我非常接近,但我在某处有一个小错误。有人可以帮帮我吗??
<script type="text/javascript">
// Popup window code
function newPopup(url) {
popupWindow = window.open(url,'popUpWindow','height=450,width=600,left=10,top=10,resizable=no,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
}
function bigimg(x) {
x.style.height="65px";
x.style.width="85px";
x.style.opacity="0.5";
}
function defaultimg(x) {
x.style.height="60px";
x.style.width="80px";
}
function teamback(x) {
document.getElementById("x").src = document.getElementById("defaultone").src;
}
</script>
</head>
<body>
Your Team <img id="defaultone" onmouseover="bigimg(this)" onclick="teamback(this)" onmouseout="defaultimg(this)" src="cowboys.gif"> vs <img id="defaulttwo" onmouseover="bigimg(this)" onclick="teamback(this)" onmouseout="defaultimg(this)" src="giants.gif"><img src="" id="actualone" style="width:85px; height:65px;"><br><br>
<img src="colts.gif"> vs <img src="bears.gif">
</body>
</html>