首页 > 语言 > JavaScript > 正文

JQuery文字列表向上滚动的代码

2024-05-06 15:54:56
字体:
来源:转载
供稿:网友
JQuery实现的文字列表一条一条向上滚动的效果

jQuery实现代码如下:

复制代码 代码如下:


<script type="text/javascript">
$(function(){
 $("#newly").hover(function(){
  clearInterval(scrtime);
 },function(){
  scrtime=setInterval(function(){
   $ul=$("#newly ul");
   liheight=$ul.find("li:first").height();
   $ul.animate({marginTop:"-10px"},1000,function(){
    $ul.find("li:first").appendTo("#newly ul");
    $ul.find("li:first").hide();
    $ul.css("margin-top","0px");
    $ul.find("li:first").show();
   });
  },4200);
 }).trigger("mouseleave");
});
</script>

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选