<div class="codetitle"> <span><a style="CURSOR: pointer" data="32761" class="copybut" id="copybut32761" onclick="doCopy('code32761')"><u>复制代码</u></a></span>如下代码:</div> <div class="codebody" id="code32761"> <br>渡 //EN" "http://www.w3.org/TR/html4/loose.dtd"><br><br> <br> <title>新文档 </title> <br> <style type="text/css"> *{margin:0;padding:0;}<BR> ul{list-style:none except none}<BR> .slchanpin001{宽度:200px;边框:1px 纯橙色;边距:55px 自动}<BR> .slchanpin001-t{高度:25px;背景:橙色}<BR> .slchanpin001-c{宽度:200px;高度: 60px;溢出:隐藏;位置:相对}<BR> .slchanpin001-c li{float:left;宽度:200px;高度:60px;背景:红色;}<BR> .slchanpingCon01{高度:60px;位置:绝对;顶部:0;左:0;}<BR> </style> <br> <br> <br> <div class="slchanpin001"> <br> <div class="slchanpin001-c"><br> <div class="slchanpingCon01" id="slchanpingCon01"><br> <ul> <br> <li>1</li> <br> <li>2</li> <br> <li>3</li> <br> <li>4< /li><BR> <li>5</li><BR> <li>6</li><br> <li>7</li><br> <li>8</li> ;<br> <li>9</li><br> <li>10</li><br> <li>10</li><br> <li>10</li><br> </ul><br> </div><br> </div><br> </div><br><br> <br> <script type="text/javascript" ><br> var sl = function(id){ return document.getElementById(id)}<br> var speed = 0;<br> var time = null;<br> var i=0;<br> function slProdust (){<br> var slchanpingCon01 = sl("slchanpingCon01").getElementsByTagName("li");<br> var slElem = sl("slchanpingCon01");<br> var slDivWidth = slchanpingCon01[0].offsetWidth * slchanpingCon01 .length;<br> slElem.style.width = slDivWidth "px";<br> 函数 autoFunc(){<br> if(speed >; -slDivWidth ){<br> 速度--;<br><br> slElem.style.left = speed "px"<br> }<br> 其他{<br><br> clearTimeout(定时器);<br> }<br> timer = setTimeout(function(){autoFunc()},10);<br> }<br> autoFunc();<br> }<br> slProdust();<br> ; <br> <br></html><br> </li> </ul> </div> </div>