jquery.eraser画笔擦除
程序员文章站
2022-03-10 22:08:14
...
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<style>
* {
margin: 0;
padding: 0;
}
div {
position: relative;
}
#topPic {
position: absolute;
z-index: 20;
}
#redux {
position: absolute;
z-index: 30;
}
</style>
</head>
<body>
<div>
<!-- 在下面的那张图片 -->
<img id="topPic" src="../img/6e812c3b6ac184535e9ade4b714efc0b.jpg" alt="" />
<!-- 在上面的那张图片 -->
<img id="redux" src="../img/a54d29c4ly1gfpido59mbj20lt0wq41u.jpg" alt="" />
</div>
</body>
<script src="../js/jquery-1.9.1.min.js"></script>
<script src="../js/jquery.eraser.js"></script>
<script>
// addEventListener( "load", init, false );
function init(event) {
$("#redux").eraser();
}
function remove(event) {
$("#redux").eraser('clear');
event.preventDefault();
}
function reset(event) {
$("#redux").eraser('reset');
event.preventDefault();
}
function grow(event) {
$("#redux").eraser("size", 200);
event.preventDefault();
}
init();
</script>
</html>