这个jQuery插件可以滚动任何div内容,包括文字,链接,图片,div等它是一个轻量级的JavaScript文件(1KB)。 您可以设置多个滚动区,控制多个参数,如滚动的方向,步骤,速度,你也可以设置一个暂停鼠标上。宽度和高度可以设置成固定或者百分比。

使用方法

$(window).load(function () {
  $("#divId").endlessScroll({ width: '90px', height: '10px', steps: -2, speed: 40, mousestop: true });
  // Recopy the previous line to add scrolling to other divs.
});

参数:

  width : 设置div宽度.
  height : 设置期望的高度
  steps : 像素为单位的滚动, 同时控制方向, negatif 表示向左 ,  positive  表示向右
  speed : 滚动速度, 从 0 (较快) 到无限(较慢).
  mousestop : 如果设置为true时,鼠标经过的div滚动将停止。

下载 演示

相关文章:

  • 2021-07-20
  • 2022-02-05
  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
  • 2021-11-13
猜你喜欢
  • 2021-06-12
  • 2022-01-25
  • 2022-02-27
  • 2021-07-18
  • 2022-12-23
  • 2021-12-21
  • 2021-11-14
相关资源
相似解决方案