☀ 使用触摸功能的简洁滑动条,采用纯 JavaScript 编写。
请访问: [http://loryjs.github.io/lory/](http://loryjs.github.io/lory/ 'lory') > 使用纯 JavaScript 编写的支持触摸的简洁滑动条。 ## 下载 lory 遵循 MIT 许可协议,支持现代环境。 还有一个预先打包的 CDN 版本,您可以使用。 #### CDN: https://cdnjs.com/libraries/lory.js/ ## 使用 yarn 安装: ``` yarn add lory.js ``` ## 将其作为 ES2015 模块进行消费: ```js import { lory } from 'lory.js';
document.addEventListener('DOMContentLoaded', () => { const slider = document.querySelector('.js_slider');
lory(slider, {
// options going here
});
});
## 将其作为一个 commonJS 模块进行消费:
```js
var lory = require('lory.js').lory;
document.addEventListener('DOMContentLoaded', function() {
var slider = document.querySelector('.js_slider');
lory(slider, {
// options going here
});
});bower install lory --save// To install dev dependencies run:
yarn
// To start the development server run:
yarn run dev
// To lint your code run:
yarn run lint
// To make a full new build run:
yarn run build// To install dev dependencies run:
yarn install
// To start the karma tests locally run:
yarn run karma-local## 前提标记 ```html ``` ## 预先配置的 CSS ``` … ``` ## 集成 ```js
## 将其作为 jQuery 插件进行集成
```js
<script src="dist/jquery.lory.js"></script>
<script>
'use strict';
$(function() {
$('.js_slider').lory({
infinite: 1
});
});
</script>暂无开放 Issues,或尚未同步最近议题。