<div class="codetitle"> <span><a style="CURSOR: pointer" data="87005" class="copybut" id="copybut87005" onclick="doCopy('code87005')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code87005"> <br> <br> <br> <br><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <br><title>?????</title> <br><script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.js"></script> <br><style type="text/css"> <BR>body,ul,li { padding:0; margin:0} <BR>ul,li { list-style:none} <BR>.img-scroll { position:relative; margin:20px auto; width:440px;} <BR>.img-scroll .prev,.img-scroll .next { position:absolute; display:block; width:50px; height:100px; background-color:#000; <BR>top:0; color:#FFF; text-align:center; line-height:100px} <BR>.img-scroll .prev { left:0} <BR>.img-scroll .next { right:0} <BR>.img-list { position:relative; width:320px; height:100px; margin-left:60px; overflow:hidden} <BR>.img-list ul { width:9999px;} <BR>.img-list li { float:left; display:inline; width:100px; margin-right:10px; height:100px; background-color:#BDBDDF; text-align:center; line-height:100px;} <BR></style> <br> <br><br> <br><div class="img-scroll"> <br><span class="prev">prev</span> <br><span class="next">next</span> <br><div class="img-list"> <br><ul> <br><li>1</li> <br><li>2</li> <br><li>3</li> <br><li>4</li> <br> </ul> <br> </div> <br> </div> <br><script type="text/javascript"> <BR>function DY_scroll(wraper,prev,next,img,speed,or) <BR>{ <BR>var wraper = $(wraper); <BR>var prev = $(prev); <BR>var next = $(next); <BR>var img = $(img).find('ul'); <BR>var w = img.find('li').outerWidth(true); <BR>var s = speed; <BR>next.click(function() <BR>{ <BR>img.animate({'margin-left':-w},function() <BR>{ <BR>img.find('li').eq(0).appendTo(img); <BR>img.css({'margin-left':0}); <BR>}); <BR>}); <BR>prev.click(function() <BR>{ <BR>img.find('li:last').prependTo(img); <BR>img.css({'margin-left':-w}); <BR>img.animate({'margin-left':0}); <BR>}); <BR>if (or == true) <BR>{ <BR>ad = setInterval(function() { next.click();},s*1000); <BR>wraper.hover(function(){clearInterval(ad);},function(){ad = setInterval(function() { next.click();},s*1000);}); <br><br>} <BR>} <BR>DY_scroll('.img-scroll','.prev','.next','.img-list',3,false); <BR></script> <br><br> <br> <br> </div>