a链接的默认事件就是跳转啊,所以要阻止默认事件,我帮你改了下:html>
Snapshots
functionshowPic(whichpic){
varsource=whichpic.getAttribute("data-img");
varplaceholder=document.getElementById('placeholder');
placeholder.setAttribute("src",source)
vartext=whichpic.getAttribute('title');
vardescription=document.getElementById("description");
description.firstChild.nodeValue=text;
}
functioncountBodyChildren(){
varbody_element=document.getElementsByTagName('body')[0];
}
window.onload=countBodyChildren;
Snapshots
fireworksCoffeeRoseBigBenChooseanimage.