<!DOCTYPE?html>
<html>
<head>
<meta?charset="UTF-8">
<title>Snapshots</title>
</head>
<script?type="text/javascript">
function?showPic(whichpic){
var?source?=?whichpic.getAttribute("href");
var?placeholder?=?docunment.getElementById('placeholder');
placeholder.setAttribute("src",source)
var?text?=whichpic.getAttribute('title');
var?description?=?document.getElementById("description");
description.firstChild.nodeValue?=?text;
}
function?countBodyChildren(){
var?body_element?=?document.getElementsByTagName('body')[0];
}
window.onload?=?countBodyChildren;
</script>
<body>
<h1>Snapshots</h1>
<ul>
<li><a?href="img/1.jpg"?title="display"?onclick="showPic(this),return?false,"?>fireworks</a></li>
<li><a?href="img/2.jpg"?title="coffee"?onclick="showPic(this),return?false,"?>Coffee</a></li>
<li><a?href="img/3.jpg"?title="rose"?onclick="showPic(this),return?false,"?>Rose</a></li>
<li><a?href="img/1.jpg"?title="clock"?onclick="showPic(this),return?false,"?>Big?Ben</a></li>
</ul>
<img?id="placeholder"?src="img/2.jpg"?style="width:?400px;height:?300px;"??alt="my?image?gallery">
<p?id="description">Choose?an?image.</p>
</body>
</html>當(dāng)我點擊鏈接的時候,會跳轉(zhuǎn)到圖片頁面 ?而不是在初始頁面下面的圖片欄顯示對應(yīng)圖片 ?為什么??
為什么點擊鏈接頁面會跳轉(zhuǎn)到圖片啊
qq_眉黛青山_0
2016-06-03 11:01:58