复制代码 代码如下:
<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>测试数据1</dt>
</dl>
<dl>
<dt>测试数据2</dt>
</dl>
<dl>
<dt>测试数据3</dt>
</dl>
<dl>
<dt>测试数据4</dt>
</dl>
<dl>
<dt>测试数据5</dt>
</dl>
<dl>
<dt>测试数据6</dt>
</dl>
<dl>
<dt>测试数据7</dt>
</dl>
<dl>
<dt>测试数据8</dt>
</dl>
<dl>
<dt>测试数据9</dt>
</dl>
<dl>
<dt>测试数据10</dt>
</dl>
</div>
<script type="text/javascript" src="/UploadFiles/2021-04-02/jquery.js"><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
<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>测试数据1</dt>
</dl>
<dl>
<dt>测试数据2</dt>
</dl>
<dl>
<dt>测试数据3</dt>
</dl>
<dl>
<dt>测试数据4</dt>
</dl>
<dl>
<dt>测试数据5</dt>
</dl>
<dl>
<dt>测试数据6</dt>
</dl>
<dl>
<dt>测试数据7</dt>
</dl>
<dl>
<dt>测试数据8</dt>
</dl>
<dl>
<dt>测试数据9</dt>
</dl>
<dl>
<dt>测试数据10</dt>
</dl>
</div>
<script type="text/javascript" src="/UploadFiles/2021-04-02/jquery.js"><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
标签:
自动循环,滚动
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“JS实现div内部的文字或图片自动循环滚动代码”评论...