3 构建类的雏形 新建scratchcard.js。 在index.html中引入scratchcard.js,在body最下边插入script代码: new ScratchCard({ canvas: document.getElementById 4 实现ScratchCard 4.1 构建ScratchCard原型 继续编写scratchcard.js: function ScratchCard(config) { this.config _init(); } + ScratchCard.prototype = { + constructor: ScratchCard, + // 初始化 + _init(); } ScratchCard.prototype = { constructor: ScratchCard, // 初始化
loop="loop" type="audio/mp3" >
cupertino.dart'; import 'package:flutter/material.dart'; import 'package:scratcher/scratcher.dart'; class ScratchCard _ScratchCardState createState() => _ScratchCardState(); } class _ScratchCardState extends State<ScratchCard
ScratchCard是一款支持移动手机的HTML5 canvas刮刮卡JS插件。该刮刮卡JS插件支持移动触摸事件,提供刮卡的回调函数,简单易用,效果非常不错。 ?
3.0,也支持 TypeScript,支持按需引入 便捷灵活的自定义设置 包含12种常见的抽奖组件 TurnTable 大转盘抽奖 Marquee 跑马灯抽奖 quareNine 九宫格抽奖 ScratchCard
find((item: { name: string }) => item.name === 'scratchCard') const bg = scratchInfo?.props?.