前台代碼: 複製程式碼 程式碼如下: 1 2 3 4 5 6 7 ; ; ; ; ; <BR><BR><BR> <BR>javascript程式碼:<BR> <BR><P>複製程式碼<P><P>程式碼如下:<div class="codetitle"><div class="codebody" id="code17095"><BR>//選擇器 <BR>function $a(id,tag){var re=(id&&typeof id!="string")?id:document.getElementById(id);if(!tag){ return re;}else{return re.getElementsByTagName(tag);}} <br><br>//焦點滾動圖點擊移動 <BR>function movec() <BR>{ <BR> bd1lfimg",""); <BR> var oli=$a("bd1lfimg","dl"); <BR> var oliw=oli[0]. =o.offsetWidth-2; <BR> var dnow=0; //目前位置 <BR> var olf=oliw-(ow-oliw 10)/2; <BR> oliw); <BR> var rqbd=$a("bd1lfsj","ul")[0]; <BR> var extime; <BR><br> var extime; <br><BR> var extime; <BR><BR> var extime; <BR><br> ¢ .length;i ){rqbd.innerHTML ="<li>" i "";}--> <br> var rq=$a("bd1lfsj","li"); <BR> for( var i=0;i<rq.length;i ){reg(i);}; <BR> oli[dnow].className=rq[dnow].className="show"; <BR> var wwww=setInterval( uu,2000); <BR><BR> function reg(i){rq[i].onclick=function(){oli[dnow].className=rq[dnow].className="";dnow=i;oli[dnow].className=rq[dnow].className="";dnow=i;oli[dnow].className=rq[dnow].className="";dnow=i;oli [dnow].className=rq[dnow].className="show";mv();}} <BR> function mv(){clearInterval(extime);clearInterval(wwww);extime=setInterval(bc,15); wwww=setInterval(uu,8000);} <BR> function bc() <BR> { <BR> var v=ns >0?Math.ceil(ns/10):Math.floor(ns/10); <BR> o["scrollLeft"] =v;if(v==0){clearInterval(extime);oli[dnow] .className=rq[dnow].className="show";v=null;} <BR> } <BR> function ) <BR> { <BR> oli[dnow].className=rq[dnow].className=""; <BR> className=rq[dnow].className="show"; <BR> } <BR> else{oli[dnow].className=rq[dnow].className="";dnow=0;oli[dnow].className=rq[dnow].className="show (); <BR> } <BR> o.onmouseover=function(){clearInterval(wwww);} <BR> o.onmouseout=function(){15)(Fextime){ 8000);} <BR>} <BR>