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

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

简介

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

如何使用它:

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

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

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

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

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

$(function(){
  $('.stonehenge').stonehenge();
});

4.配置灼热动画。

$('.stonehenge').stonehenge({

  // animation speed
  speed: 1.0,

  // config the auto-scroll behavior
  autoscroll: false,
  autoscrollOnce: true,
  autoscrollSpeed: 20,
  autoscrollPeriod: 500,
  autoscrollEasing: 'linear',
  
});

预览截图