function prepareGallery(){if(!document.getElementsByTagName) return false;if(!document.getElementById) return false;if(!document.getElementById("imagegallery")) return false;var gallery=document.getElementById("imagegallery");var links=gallery.getElementsByTagName("a");for(var i=0;i<links.lengrh;i++){links[i].onclick=function(){ return showPic(this)?false:ture;}} }function showPic(whichpic){ if(!document.getElementById("placeholder")) return false; var source = whichpic.getAttribute("href"); var placeholder = document.getElementById("placeholder"); if(placeholder.nodeName!='IMG') return false; placeholder.setAttribute("src",source); if(document.getElementById("description")){ var text=whichpic.getAttribute("title"); var description=document.getElementById("description"); if(description.firstChild.nodeValue==3){ description.firstChild.nodeValue=text; } } return true; }// JavaScript Document
添加回答
举报
0/150
提交
取消