当前位置:网站首页>H5 realize the animation effect of a scratch card
H5 realize the animation effect of a scratch card
2022-07-25 21:22:00 【InfoQ】
Preface
demand
wScratchPad.jsImplementation process
wScratchPad.jswScratchPad.jswScratchPad.jswScratchPad.js <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script type="text/javascript" src="./wScratchPad.js"></script>
<style>
#box{
width: 600px;
height: 600px;
}
</style>
<div id="box"></div>
<script>
$('#box').wScratchPad({
size: 50,
bg: './food.png',
fg: '#ccc',
realtime: true,
scratchDown: null,
scratchUp: function(e, percent){
percent > 50? $('#box').wScratchPad('clear') : '' // When the scraped area is greater than 50% , Show all the base maps
},
scratchMove: null,
cursor: 'crosshair',
});
function clear(){
}
</script>
scratchUpscratchMove
wScratchPad.js Official address
wScratchPad.jsPostscript
边栏推荐
- Leetcode-919: complete binary tree inserter
- ZigBee IOT development platform (Industrial IOT)
- Record the transfer of domain names from Alibaba cloud service providers to Huawei cloud
- Stm3 (cubeide) lighting experiment
- An interview question about interface and implementation in golang
- Debugged PEB (beingdebugged, ntglobalflag)
- Cesium 多边形渐变色纹理(Canvas)
- 有哪些优化mysql索引的方式请举例(sqlserver索引优化)
- Leetcode-155: minimum stack
- 一道golang中关于map的并发读写的面试题
猜你喜欢

Unity vs -- the default debugging in VS is to start rather than attach to unity debugging

作为测试,如何理解线程同步异步

SSH private key realizes login to remote target server

Leetcode-6131: the shortest dice sequence impossible to get

Leetcode skimming -- guess the size of numbers II 375 medium

ONEFLOW V0.8.0 officially released

Detailed explanation of Ag search tool parameters

浅谈web性能优化(一)

测试用例和缺陷报告模板

Test cases and defect report templates
随机推荐
DDD的Go实战
一道golang中关于接口和实现的面试题
An interview question about recover in golang
Database SQL statement exercise "suggestions collection"
[manageengine]itsm application in retail industry
On Web Performance Optimization (1)
Huatai Securities account opening process, is it safe to open an account on your mobile phone
字节一面:TCP 和 UDP 可以使用同一个端口吗?
Research: more than 70% of doctors are still prescribing unsafe antibiotic drugs
Cesium polygon gradient texture (canvas)
基于腾讯地图实现精准定位,实现微信小程序考勤打卡功能
Debugged PEB (beingdebugged, ntglobalflag)
Based on pexels image material API, sort out the material resource library
MPI learning notes (II): two implementation methods of matrix multiplication
ZigBee IOT development platform (Industrial IOT)
cts测试步骤(卡西欧cts200测试)
Array of arm disassembly
The role of the resize function is "suggestions collection"
[technical dry goods] how to ensure the idempotency of the interface?
DDD go practice