silver-zebra
v0.0.5
Published
跑马灯滚动组件,主要解决元素在容器中的循环滚动
Downloads
2
Readme
silver-zebra
silver-zebra
Features
- 样式示例:
demo
https://g.alicdn.com/silvermine/silver-zebra/0.0.2/demo/index.html
Installation
- npm install silver-zebra
Usage
- script 标签引入
<script src="https://g.alicdn.com/silvermine/silver-zebra/{version}/index.min.js"></script>
- import or require
- 首先
npm install silver-zebra
import Zebra from 'silver-zebra
或者const Zebra = require('silver-zebra')
- 首先
jsdoc 接口页面
API
new window.tvcnpt.SilverZebra(cfg)
example:
/** * constructor 构造函数 * @memberOf SilverZebra.prototype * @param cfg {Object} 配置参数 * @param target {String} 滚动元素 * @param auto {String} 自动滚动(手动/自动) 默认为自动 * @param direction {String} "up/down/left/right" 默认为up * @param speed {String} 滚动速度 "slow/middle/fast" 默认slow */ var tmp = new window.tvcnpt.SilverZebra( { target: "#a1", direction: "up" });
startMove()开始滚动(手动触发)
example:
tmp.startMove();
stopMove()停止滚动
example:
tmp.stopMove();