<div class="codetitle"> <span><a style="CURSOR: pointer" data="25263" class="copybut" id="copybut25263" onclick="doCopy('code25263')"><u>复制代</u></a></span> 代码如下:</div> <div class="codebody" id="code25263"> <br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <BR><html xmlns="http://www.w3.org/1999/xhtml"> <br> <br><meta http-equiv="Content-Type" content="text/html; charset=gbk"> <br><title>测试</title> <br><meta name="著者" content="ximan"> <br><meta name="keywords" content=""> <br><メタ名="説明" コンテンツ=""> <br><link type="text/css" rel="stylesheet" href="index.css"> <br></head> <br> <br><div class="コンテンツ"> <br><ul id="num"> <br><li style="background: #f00;"> <br></li> <br><li> <br></li> <br> </li> <li> <br></li> <br> </li> <li> <br></li> <br> </li> <li> <br></li> <br> <br><ul id="img_box"> <br> </li> <li> <br><a href="#"> <br><img src="pailabi_shop1.jpg" alt="哈哈哈" /> <br></a> <br></li> <br> </li> <li> <br><a href="#"> <br><img src="pailabi_shop2.jpg" alt="哈哈哈" /> <br></a> <br></li> <br> </li> <li> <br><a href="#"> <br><img src="paila_shop3.jpg" alt="哈哈哈" /> <br></a> <br></li> <br> </li> <li> <br><a href="#"> <br><img src="paila_shop4.jpg" alt="哈哈哈" /> <br></a> <br></li> <br> </li> <li> <br><a href="#"> <br><img src="paila_shop5.jpg" alt="哈哈哈" /> <br></a> <br></li> <br> <br> </li> </div> <br><script type="text/javascript"> <br></script> <br><script type="text/javascript"> <br>window.onload=function (){ <br>var num = document.getElementById("num"); <br>var num_li = document.getElementById("num").getElementsByTagName("li"); <br>var img_box = document.getElementById("img_box"); <br>var img_box_li = document.getElementById("img_box").getElementsByTagName("li"); <br>var bliw = img_box_li[0].offsetWidth; <br>var n = 0; <br>img_box.style.left = 0 <br>var autoscroll = setInterval(auto,3000); <br>for (var i = 0;i num_li[i].onmouseover = function(){ <br>clearInterval(autoscroll); <br>for (var i = 0;i <br>num_li.length;i ){ <br>num_li[i].style.background = ""; <br>if(num_li[i]==this){ <br>this.style.background = "#f00"; <br>スライド(i); <br>} <br>} <br>} <br>num_li[i].onmouseout = function(){ <br>for (var i = 0;i < num_li.length;i ){ <br>if (num_li[i]==this){ <br>n = i; <br>autoscroll = setInterval(auto,3000) <br>} <br>} <br>} <br>} <br>function slide(i){ <br>img_box.style.left = -bliw*i "ピクセル"; <br>} <br>関数 auto(){ <br>n ; <br>if(n == img_box_li.length){ <br>n =0; <br>} <br>for (var i =0;i < num_li.length;i ){ <br>num_li[i].style.background = ""; <br>} <br>num_li[n].style.background = "#f00"; <br>スライド(n); <br>} <br>} <br></script> <br></body> <br></html>