手机首个自动刷卡器/旋转木马插件 jQuery stonehenge.js

  • 源码大小:7.7KB
  • 所需积分:1积分
  • 源码编号:19JP-3122
  • 浏览次数:795次
  • 最后更新:2023年05月08日
  • 所属栏目:滑块
我要下载
加入收藏
本站默认解压密码:19jp.com 或 19jp_com

简介

stonehenge.js是一个轻量级的jQuery插件,用于创建自动、水平、可拖动和可滑动的旋转木马/滚动器,以平滑和交互式地展示您的内容。

如何使用它:

1.将jQuery库和stonehenge.js插件的文件插入到HTML文档中。

  1. <link rel="stylesheet" href="/path/to/dist/stonehenge.css">
  2. <script src="/path/to/cdn/jquery.min.js"></script>
  3. <script src="/path/to/dist/stonehenge.js"></script>

2.将您的内容添加到巨石阵容器中,如下所示:

  1. <div class="stonehenge">
  2. <div>Item 1</div>
  3. <div>Item 2</div>
  4. <div>Item 3</div>
  5. ... more items here ...
  6. </div>

3.调用顶部容器上的函数来生成一个基本的转盘/滑动器/滚动器。

  1. $(function(){
  2. $('.stonehenge').stonehenge();
  3. });

4.配置灼热动画。

  1. $('.stonehenge').stonehenge({
  2.  
  3. // animation speed
  4. speed: 1.0,
  5.  
  6. // config the auto-scroll behavior
  7. autoscroll: false,
  8. autoscrollOnce: true,
  9. autoscrollSpeed: 20,
  10. autoscrollPeriod: 500,
  11. autoscrollEasing: 'linear',
  12. });

预览截图