<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> <mce:style type="text/css"><!-- #div { position:absolute; left:81px; top:11px; width:300px; height:400px; z-index:0; border : solid 0px purple ; display:none; } --></mce:style><style type="text/css" mce_bogus="1">#div { position:absolute; left:81px; top:11px; width:300px; height:400px; z-index:0; border : solid 0px purple ; display:none; }</style> <mce:script type="text/javascript"><!-- function openDiv() { var ddd=document.getElementById("div"); ddd.style.display="block"; var photos=""; for(var i=1;i<=100;i++) { photos+='<img id='+i+' alt="" src="images/'+i+'.bmp" mce_src="images/'+i+'.bmp" οnclick="ck(this.id)"/>' photos+=" "; } ddd.innerHTML=photos; ddd.scrollIntoView(); } function ck(v) { document.getElementById("div").style.display="none"; document.getElementById("img").src="images/"+v+".bmp"; } // --></mce:script> </head> <body> <div id="div"> </div> <img alt="" id="img" src="images/1.bmp" mce_src="images/1.bmp"/> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> <label> <input type="button" name="Submit" value="选择头像" οnclick="openDiv()" /> </label> </p> </body> </html>