【发布时间】:2025-12-31 06:50:16
【问题描述】:
如何添加指向这些随机图像集的链接。我想要分别指向 A B 和 C 的链接,并且我希望这些颜色匹配。在我正在处理的页面(我自己的个人艺术网站)中,这些颜色将是图像。
http://rollinleonard.com/please-help/
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Rollin Leonard</title>
</head>
<body>
<SCRIPT LANGUAGE="Javascript">
function banner() { } ; b = new banner() ; n = 0
b[n++]= "<IMG name=randimg SRC='http://rollinleonard.com/please-help/images/green_01.gif' border='0' ALT=''><IMG name=randimg SRC='http://rollinleonard.com/please-help/images/green_02.gif' border='0' ALT=''><IMG name=randimg SRC='http://rollinleonard.com/please-help/images/green_03.gif' border='0' ALT=''>"
b[n++]= "<IMG name=randimg SRC='http://rollinleonard.com/please-help/images/purple_01.gif' border='0' ALT=''><IMG name=randimg SRC='http://rollinleonard.com/please-help/images/purple_02.gif' border='0' ALT=''><IMG name=randimg SRC='http://rollinleonard.com/please-help/images/purple_03.gif' border='0' ALT=''>"
b[n++]= "<IMG name=randimg SRC='http://rollinleonard.com/please-help/images/yellow_01.gif' border='0' ALT=''><IMG name=randimg SRC='http://rollinleonard.com/please-help/images/yellow_02.gif' border='0' ALT=''><IMG name=randimg SRC='http://rollinleonard.com/please-help/images/yellow_03.gif' border='0' ALT=''>"
i=Math.floor(Math.random() * n) ;
document.write( b[i] )
</SCRIPT>
</body>
</html>
【问题讨论】: