新闻上下滚动插件

//头条新闻上下滚动

 <div class="mesBox" id="mesBox">
                        <span></span>
                        <ul class="latest_txt">
                            <li>
                       <a href="##" style="color:#ca4712;">ceshiceishiceshi </a> 
                                </li>
                  
                            </ul>
                    </div>



//调用
$('#mesBox').Slidepag(5000)

//js
//头条新闻上下滚动
(function($){
$.fn.Slidepag=function(speed){
new Slide(this,speed);
}
function Slide(obj,speed){
var self=this;
$(obj).hover(function(){
self.stop();
},function(){
self.start();
})
this.start=function(){
this.begin=setInterval(function(){
$(obj).find('ul>li:eq(0)').animate({'margin-top':'-35px'},'slow',function(){
$(this).clone().css('margin-top',0).appendTo($(obj).find('ul'));
$(this).remove();
})
},speed)
}
this.stop=function(){
clearInterval(this.begin);
}
self.start();
}
})(jQuery)

 

 

 

 

 

 

  

 

 

  

原文地址:https://www.cnblogs.com/chenglideyueguang/p/7073455.html