下面是JS部分:
// JavaScript Document
function showpic(whichpic){
var placeholder=document.getElementById('placeholder'); //获开占位符的DOM
var source=whichpic.getAttribute("href"); //获开被点击图片的href
placeholder.setAttribute("src",source); //修改占位符的src地址
var p=document.getElementById("box");
p.childNodes[0].nodeValue=source;
}
function prepareGallery(){
if(!document.getElementById){return false};
if(!document.getElementsByTagName){return false};
if(!document.getElementById("imagegallery")){return false};
var placeholder=document.getElementById("imagegallery"); //获开UL的DOM
var links=placeholder.getElementsByTagName("a"); //获开UL的a标签集合