<div class="codetitle"> <span><a style="CURSOR: pointer" data="41460" class="copybut" id="copybut41460" onclick="doCopy('code41460')"><u>复制代</u></a></span> 代码如下:</div> <div class="codebody" id="code41460"> <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><title>無題ページ</title> <br><link rel="Stylesheet" type="text/css" href="Result-Css/reset/reset-min.css" /> <br><style type="text/css"> <br>.w_con{幅:400px;高さ:160ピクセル;オーバーフロー:非表示; border:1px ソリッド #333;} <br>#w_slid{ width:100%;} <br>#w_slid li{ width:100%; height:40px;} <br>li.a{background:#ffc000;} <br>li.b{background:#56aaff;} <br>li.c{background:#0fffaa;} <br>li.d { 背景:#0ffffa;} <br>li.e{ 背景:#ffff56;} <br></style> <br><script type="text/javascript" src="Result-JavaScriptOrJQuery/jquery/jquery-1.7.2.js"></script> <br></head> <br> <br><div class="w_con" id="w_con"> <br><ul id="w_slid"> <br><li class="a"></li> <br><li class="b"></li> <br><li class="c"></li> <br><li class="d"></li> <br><li class="e"></li> <br> <br> </div> <br><script type="text/javascript"> <br>function slide() { <br>var $w_slid = $('#w_con'); <br>console.log($w_slid); <br>var タイマー; <br>$w_slid.hover(function(){ <br>clearInterval(Timer); <br>},function(){ <br>Timer = setInterval(function(){ <br>slideFadeIn($w_slid); <br>},3000); <br>}).trigger("mouseleave"); <br>} <br>function slideFadeIn(obj) { <br>var $self = obj.find('ul:first'); <br>var $height = $self.find('li:first').height(); <br>console.log($height); <br>$self.animate({ <br>'marginTop': $height 'px', <br>}, 1200, function () { <br>$self.css({ marginTop: 0 }).find( "li:first").appendTo($self); <br>$self.find("li:first").hide(); <br>$self.find("li:first").fadeIn("遅い");<br>}); <br>} <br>$(function () { <br>slide(); <br>}); <br></script> <br></body> <br></html> <br>