我需要将与 5 个不同图像关联的链接动态传递给不同的图像。我已经创建了更改图像的功能,但这是我无法找到答案的最后一部分。到目前为止,这是我的代码:
<html>
<head><title>Revolving Pictures</title>
<script type="text/javascript">
function changeBigPic(newPic){
var big = document.getElementById("bigPic");
big.src = newPic;
//***How do I get the href of the 'album' images to 'bigPic'? I'm also trying to double the size of bigPic and using 200% makes the image enormous! Thanks in advance
}
</script>
</head>
<body>
<img name="bigPic" id="bigPic" src="album1.jpg" height="200%" width="200%"><br />
<A HREF="http://stevenseagal.com/"><img src="album1.jpg" id="segal" onmouseover="changeBigPic(document.getElementById('segal').src);">
  <A HREF="http://www.richardcheese.com/" target="_blank"><img src="album2.jpg" id="cheese" onmouseover="changeBigPic(document.getElementById('cheese').src);">
  <A HREF="http://www.myspace.com/etjusticepourtous" target="_blank"><img src="album3.jpg" id="justice" onmouseover="changeBigPic(document.getElementById('justice').src);">
  <A HREF="http://www.bestcoast.us/" target="_blank"><img src="album4.jpg" id="bestCoast" onmouseover="changeBigPic(document.getElementById('bestCoast').src);">
  <A HREF="http://www.van-halen.com/" target="_blank"><img src="album5.jpg" id="vanHalen" onmouseover="changeBigPic(document.getElementById(this.id).src);">
</body>
<html>