SongHb
2014-08-28 13:53:39
jquery实现微信刮刮乐特效源代码下载
wScratchPad是jQuery上的一个插件,它能模拟出刮的行为,使你能“擦去”一层覆盖物,这层覆盖物既可是一个图片,也可以是某种颜色涂层。
官方网址为 http://wscratchpad.websanova.com/
配置选项:
$('#elem').wScratchPad({ size : 5, // The size of the brush/scratch. bg : '#cacaca', // Background (image path or hex color). fg : '#6699ff', // Foreground (image path or hex color). realtime : true, // Calculates percentage in realitime. scratchDown : null, // Set scratchDown callback. scratchUp : null, // Set scratchUp callback. scratchMove : null, // Set scratcMove callback. cursor : 'crosshair' // Set cursor. });
示例
包含头文件:
<script type="text/javascript" src="./wScratchPad.min.js"></script>
Percent scratched
$("#elem").wScratchPad({ scratchDown: function(e, percent){ console.log(percent); }, scratchMove: function(e, percent){ console.log(percent); }, scratchUp: function(e, percent){ console.log(percent); } });
Update on the Fly
var sp = $("#elem").wScratchPad(); sp.wScratchPad('size', 5); sp.wScratchPad('cursor', 'url("./cursors/coin.png") 5 5, default'); // Or directly with element. $("#elem").wScratchPad('image', './images/winner.png');
Methods
$('#elem').wScratchPad('reset'); $('#elem').wScratchPad('clear'); $('#elem').wScratchPad('enabled', <boolean>);
有图有真相
这是demo
配合其他图片
猜你喜欢
请下载代码后再发表评论
文件名:微信刮刮乐源码.rar,文件大小:297.809K
下载
- /
- /cursors
- /cursors/Thumbs.db
- /cursors/bird.png
- /cursors/coin.png
- /cursors/god-sword.png
- /cursors/leaf.png
- /cursors/mario.png
- /images
- /images/scratch-to-win.png
- /images/slide1.jpg
- /images/slide2.jpg
- /images/slide3.jpg
- /cursors
![最代码相关代码源代码列表](https://static.zuidaima.com/resource/img/heart_ico.png)
![最代码最近下载分享源代码列表](https://static.zuidaima.com/resource/img/heart_ico.png)
SZEPEZS LV8
3月8日
ZN_0316 LV1
2021年6月23日
142777813 LV1
2020年5月31日
wangyanbin LV7
2019年3月20日
1792312911 LV17
2018年6月22日
q504721053 LV5
2018年5月6日
tian1234 LV18
2017年9月17日
564311694 LV1
2017年6月1日
jjljldjsl LV1
2017年3月10日
namo99 LV1
2017年3月9日
![最代码最近浏览分享源代码列表](https://static.zuidaima.com/resource/img/cattle_ico.png)
SZEPEZS LV8
3月8日
wxy0309 LV6
2023年5月30日
高腾达 LV3
2023年5月22日
dh03240309 LV2
2023年2月15日
夜上清元 LV8
2022年6月16日
微信网友_5917684846972928 LV2
2022年4月15日
abcdljw LV20
2021年12月28日
二十一画 LV10
2021年11月14日
ZN_0316 LV1
2021年6月23日
dwadawd LV7
2021年6月16日