欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

JS實(shí)現(xiàn)div內(nèi)部的文字或圖片自動(dòng)循環(huán)滾動(dòng)代碼

 更新時(shí)間:2013年04月19日 16:36:23   作者:  
在某些情況下需要這樣的功能:使用JS實(shí)現(xiàn)div內(nèi)部的文字或圖片自動(dòng)循環(huán)滾動(dòng),接下來為大家詳細(xì)介紹下實(shí)現(xiàn)方法,感興趣的朋友可以參考下哈
復(fù)制代碼 代碼如下:

<style type="text/css">
.content{width:500px;height:300px;position:absolute;left:200px;top:100px;border:solid 2px red;padding:10px;overflow:hidden}
dl{width:400px;height:30px;border:1px solid black;}
</style>
<div class="content">
<dl>
<dt>測(cè)試數(shù)據(jù)1</dt>
</dl>
<dl>
<dt>測(cè)試數(shù)據(jù)2</dt>
</dl>
<dl>
<dt>測(cè)試數(shù)據(jù)3</dt>
</dl>
<dl>
<dt>測(cè)試數(shù)據(jù)4</dt>
</dl>
<dl>
<dt>測(cè)試數(shù)據(jù)5</dt>
</dl>
<dl>
<dt>測(cè)試數(shù)據(jù)6</dt>
</dl>
<dl>
<dt>測(cè)試數(shù)據(jù)7</dt>
</dl>
<dl>
<dt>測(cè)試數(shù)據(jù)8</dt>
</dl>
<dl>
<dt>測(cè)試數(shù)據(jù)9</dt>
</dl>
<dl>
<dt>測(cè)試數(shù)據(jù)10</dt>
</dl>
</div>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(function(){
$('.content dl').hide();
$('.content dl:gt('+($('.content dl').length - 5)+')').show();
window.setInterval(function(){
$('.content dl:visible:first').prev().slideDown("fast",function(){
$(this).animate({opacity:1},2000,function(){
if($('.content dl:hidden').length == 0){
$('.content dl').hide();
$('.content dl:gt('+($('.content dl').length - 5)+')').show();
}
});
});
},1000);
});
</script>

代碼演示地址:
http://www.nailyo.com/js_demo/gundong.html

相關(guān)文章

最新評(píng)論