Socket
Socket
Sign inDemoInstall

mk-mycom-sequenceframe

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mk-mycom-sequenceframe

a sequenceFrame component


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Install size
7.33 kB
Created
Weekly downloads
 

Readme

Source

以下为序列帧组件的使用方法(淘宝小程序)

作者:Kevin.W

npm安装:npm i mk-mycom-sequenceframe


json引用
"usingComponents": {
  "sequence-frame": "/pages/mk-mycom-sequenceframe/sequence-frame"
}

页面引用
<sequence-frame
  mode="normal" 
  url="{{xlz}}"
  width="{{750}}"
  sec="{{100}}"
  preload="{{100}}"
  loop="{{false}}"
  destroy="{{false}}"
  onRef="onRef" 
  onChange="onChange"
></sequence-frame>

js示例
onRef(e) {
  // e为返回的序列帧实例化内容
  this.sf = e;
},
onChange(e) {
  // e为返回的序列帧状态
  console.log(e);
},
pause(){
  this.sf.pause();
},
stop(){
  this.sf.stop();
}

属性说明
字段名类型必填描述
modeString序列帧模式(支持按钮--btn,常态--normal两种模式,默认为常态)
urlArray序列帧图片
widthNumber图片宽度
secNumber图片切换时间(毫秒,默认10ms)
preloadNumber图片预加载时间(毫秒,默认为50ms)
loopBoolean是否循环(默认为false)
destroyBoolean结束时是否销毁(默认为false)
onRefFunction序列帧实例化
onChangeFunction序列帧状态回调

方法说明
方法名描述
pause序列帧暂停(不会回到第一张)
stop序列帧停止

注意
  • 图片切换时间最好不要低于10ms每张
  • 图片数量最好不超过50张,且单张图片尽量不要大于 80kb
  • 图片预加载时间最好不要低于50ms,图片越大预加载时间应越长

Keywords

FAQs

Last updated on 18 Jun 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc