首页 > 前端
聊一聊无缝不间断向上滚动代码
来源:TP课堂 时间:2022-12-26 点击:361

起初是用superslide实现的,文档链接:http://www.superslide2.com/demo.html

效果棒棒哒。

除了滚动之前,再看一个控制状态的按钮,点击按钮播放和暂停。

需要在.txtMarquee-top中添加一个按钮<div class='button'>按钮</div>

var ary = location.href.split("&");
jQuery(".txtMarquee-top").slide({ mainCell: ".bd ul", effect: "topMarquee", vis: 3, autoPlay: true, interTime: 50, playStateCell: '.button', mouseOverStop: false });


但是客户总有个性需求,而superslide的实现是人家已经封装好的库,不能任意改动js。所以改用新代码。

demo预览