标签:
<!doctype html> <html> <head> <meta charset="utf-8"> <title>无标题文档</title> </head> <style type="text/css"> .asd{ background-color:#1ADC9D; border:2px solid:#F30A0E; width:25px; height:25px; color:#1A3CDC; } </style> <script> <!-- var n=1; var qwe=0; function init() { var list=document.getElementsByTagName("label"); for(var i=0;i<list.length;i++) list[i].onmouseover=function() { qwe=1; var b=this.innerText*1; var img=document.getElementById("img"); img.src="images/"+b+".jpg"; document.getElementById("l"+b).className="asd"; } for(var i=0;i<list.length;i++) list[i].onmouseout=function() { qwe=0; var b=this.innerText*1; document.getElementById("l"+b).className="zxc"; } fun1(); } function clean() { kiss=document.getElementsByTagName("label"); for(var i=0;i<kiss.length;i++) kiss[i].className="zxc"; } function fun1() { if(qwe==0) { if(n==7) n=1; var p=document.getElementById("img"); p.src="images/"+n+".jpg"; clean(); kiss=document.getElementsByTagName("label"); kiss[n-1].className="asd"; n++; } else kiss[n-2].className="zxcv"; setTimeout("fun1()",1000); } //--> </script> <body onLoad="init()"> <div id="qwe"> <img width="800" height="600" id="img" src="images/6.jpg"> <div> <label id="l1"> 1 </label> <label id="l2"> 2 </label> <label id="l3"> 3 </label> <label id="l4"> 4 </label> <label id="l5"> 5 </label> <label id="l6"> 6 </label> </div> </div> </body> </html>
标签:
原文地址:http://www.cnblogs.com/JLUyeyu/p/5076526.html