<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><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 전환//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=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; 여백:0} <br>ul,li { 목록 스타일: 없음} <br>.img-scroll { 위치:상대적; 여백:20px 자동; 너비:440px;} <br>.img-scroll .prev,.img-scroll .next { 위치:절대; 표시:블록; 너비:50px; 높이:100px; 배경색:#000; <br>상단:0; 색상:#FFF; 텍스트 정렬:가운데; line-height:100px} <br>.img-scroll .prev { 왼쪽:0} <br>.img-scroll .next { 오른쪽:0} <br>.img-list { 위치:상대적; 너비:320px; 높이:100px; 여백-왼쪽:60px; 오버플로:숨김} <br>.img-list ul { 너비:9999px;} <br>.img-list li { float:left; 표시:인라인; 너비:100px; 여백 오른쪽:10px; 높이:100px; 배경색:#BDBDDF; 텍스트 정렬:가운데; line-height:100px;} <br></style> <br></head> <br><br><본문> <br><div class="img-scroll"> <br><span class="prev">이전</span> <br><span class="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>함수 DY_scroll(wraper,prev,next,img,speed,or) <br>{ <br>var Wraper = $(wraper); <br>var prev = $(prev); <br>var next = $(다음); <br>var img = $(img).find('ul'); <br>var w = img.find('li').outerWidth(true); <br>var s = 속도; <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>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 (또는 == 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></body> <br></html> <br><br> </div>