首页轮播图片 怎样调用?会的人帮帮忙。![](../ebb_data/smile/ecms4.gif) 改成首页图片轮播
<div id="img_box_2"> <a href="" title="网" class=""> <img src="" alt="网"> <h2>网</h2> </a> <a href="" title="让人" class=""> <img src="" alt="让人"> <h2>让人</h2> </a> <a href="" title="" class=""> <img src="" alt="> <h2></h2> </a> </div>
<!-- hot_img_2 --> <script language="javascript" type="text/javascript"> <!-- var _hot_img_2=document.getElementById("hot_img_2"); var _img_box_2=document.getElementById("img_box_2"); var _a=_img_box_2.getElementsByTagName("a"); var _node; var _timer; if(_a.length>0){ _a[0].className="here"; _node=_a[0]; var _ul=document.createElement("ul"); _ul.id="img_index_2"; for(var i=0;i<_a.length;i++){ _a[i].onmouseover=cleartimeout; _a[i].onmouseout=settimeout; var _li=document.createElement("li"); _li.innerHTML=i+1; _li.onmouseover=function(){ cleartimeout(); this.onmouseout=settimeout; if(Browser.isIE){ _img_box_2.filters[0].transition=Math.floor(24*Math.random()); _img_box_2.filters[0].apply(); } for(var i=0;i<_li.length;i++){_li[i].className="";_a[i].className="";} this.className="here"; _node=_a[parseInt(this.innerHTML)-1]; _node.className="here"; if(Browser.isIE){_img_box_2.filters[0].play();} }; _ul.appendChild(_li); } _hot_img_2.appendChild(_ul); _li=_ul.getElementsByTagName("li"); _li[0].className="here"; } function play_hot_img_2(){ if(_a.length<=1){return;} cleartimeout(); if(Browser.isIE){ _img_box_2.filters[0].transition=Math.floor(24*Math.random()); _img_box_2.filters[0].apply(); } for(var i=0;i<_a.length;i++){ if(_node==_a[i]){ for(var j=0;j<_li.length;j++){_li[j].className="";} _node.className=""; if(_node!=_a[_a.length-1]){_node=_a[i+1];_li[i+1].className="here";} else{_node=_a[0];_li[0].className="here";} _node.className="here"; break; } } if(Browser.isIE){_img_box_2.filters[0].play();} _timer=window.setTimeout(play_hot_img_2,5000); } function settimeout(){ window.clearTimeout(_timer); _timer=window.setTimeout(play_hot_img_2,1000); } function cleartimeout(){ window.clearTimeout(_timer); } var Browser = { 'isIE' : (navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0), 'isFirefox' : navigator.userAgent.indexOf('Firefox') >= 0, 'isOpera' : navigator.userAgent.indexOf('Opera') >= 0 }; _timer=window.setTimeout("play_hot_img_2()",3000); //--> </script>
|