上下滚动播报特效
2016-11-28 00:00
274 查看
html:
<div style="height:50px;overflow:hidden;font-size: 14px;font-weight: bold;">
<ul class="line">
<li style="line-height:25px;">
<span class="glyphicon glyphicon-hand-right"></span>
<span style="color:red;">最新播报1</span>
<span style="color:#5CB85C;">test1</span>
<span class="glyphicon glyphicon-hand-right"></span>
<span style="color:red;">最新播报2</span>
<span style="color:#5CB85C;">test2</span>
<span class="glyphicon glyphicon-hand-right"></span>
<span style="color:red;">最新播报3</span>
<span style="color:#5CB85C;">test3</span>
</li>
</ul>
</div>
script:
<script>
$(function(){
var _wrap=$('ul.line');
var _interval=2000;
var _moving;
_wrap.hover(function(){
clearInterval(_moving);
},function(){
_moving=setInterval(function(){
var _field=_wrap.find('li:first');
var _h=_field.height();
_field.animate({marginTop:-_h+'px'},600,function(){
_field.css('marginTop',0).appendTo(_wrap);
})
},_interval);
}).trigger('mouseleave');
});
</script>
<div style="height:50px;overflow:hidden;font-size: 14px;font-weight: bold;">
<ul class="line">
<li style="line-height:25px;">
<span class="glyphicon glyphicon-hand-right"></span>
<span style="color:red;">最新播报1</span>
<span style="color:#5CB85C;">test1</span>
<span class="glyphicon glyphicon-hand-right"></span>
<span style="color:red;">最新播报2</span>
<span style="color:#5CB85C;">test2</span>
<span class="glyphicon glyphicon-hand-right"></span>
<span style="color:red;">最新播报3</span>
<span style="color:#5CB85C;">test3</span>
</li>
</ul>
</div>
script:
<script>
$(function(){
var _wrap=$('ul.line');
var _interval=2000;
var _moving;
_wrap.hover(function(){
clearInterval(_moving);
},function(){
_moving=setInterval(function(){
var _field=_wrap.find('li:first');
var _h=_field.height();
_field.animate({marginTop:-_h+'px'},600,function(){
_field.css('marginTop',0).appendTo(_wrap);
})
},_interval);
}).trigger('mouseleave');
});
</script>
相关文章推荐
- msclass实例 jquery 通用滚动特效,文字单行,多行停留滚动,图文上下左右滚动
- js文字上下滚动特效
- 向上下左右滚动图片的特效
- 页面全屏滚动特效(上下或左右)
- 用JavaScript实现上下文字滚动特效
- 图片上下滚动特效
- 一款jquery打造的特炫酷的全屏上下滚动的jquery焦点图特效
- jquery Xslider 插件焦点图片特效图片淡隐淡现、图片上下滚动、图片左右滚动、选项卡
- 面向对象的无缝上下滚动图片特效代码
- 网页特效--图片连续滚动(上下左右)
- javascript实现无缝上下滚动特效
- 用JavaScript实现上下文字滚动特效
- 用JavaScript实现上下文字滚动特效
- jquery制作banner图片左右上下切换滚动特效
- angularjs实现文字上下无缝滚动特效代码
- jquery图片上下翻滚、图片左右翻滚、图片淡隐淡现3种图片滚动特效
- C# 文字滚动特效(上下滚动)
- jquery 通用滚动特效,文字单行,多行停留滚动,图文上下左右滚动
- 图片列表带箭头上下无缝滚动展示特效
- javascript:新闻上下滚动特效