Ich habe noch eine Alternative gefunden. ein Jquery plugin. Damit kann man Bilder explodieren lassen.
https://www.jqueryscript.net/animation/Create-An-Image-Explosion-Effect-In-jQuery-imgexplode-js.html
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.3.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jcanvas/21.0.0/jcanvas.js"></script>
<script src="jquery.imgexplode.js"></script>
<title>Move to Click Position</title>
<style type="text/css">
#myCanvas {
position: absolute;
top: 0px;
left: 0px;
border: 1px red solid;
background-color : #FFEFDB;
}
</style>
</head>
<body>
<canvas id="myCanvas" width="500" height="400" >
Your browser does not support the HTML5 canvas tag.
</canvas>
<script>
function explode() {
$("ballon0.png").explodeRestore();
setTimeout(function () {
$("ballon0.png").explode({
maxWidth: 12,
minWidth: 3,
radius: 331,
release: false,
recycle: false,
explodeTime: 400,
canvas: true,
maxAngle: 360,
gravity:false,
});
}, 300)
}
explode();
</script>
</body>
</html>
Auf der Webseite funktioniert es. Hier kommen 2 Fehlermeldung
Laden fehlgeschlagen und Type error
https://www.jqueryscript.net/animation/Create-An-Image-Explosion-Effect-In-jQuery-imgexplode-js.html
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.3.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jcanvas/21.0.0/jcanvas.js"></script>
<script src="jquery.imgexplode.js"></script>
<title>Move to Click Position</title>
<style type="text/css">
#myCanvas {
position: absolute;
top: 0px;
left: 0px;
border: 1px red solid;
background-color : #FFEFDB;
}
</style>
</head>
<body>
<canvas id="myCanvas" width="500" height="400" >
Your browser does not support the HTML5 canvas tag.
</canvas>
<script>
function explode() {
$("ballon0.png").explodeRestore();
setTimeout(function () {
$("ballon0.png").explode({
maxWidth: 12,
minWidth: 3,
radius: 331,
release: false,
recycle: false,
explodeTime: 400,
canvas: true,
maxAngle: 360,
gravity:false,
});
}, 300)
}
explode();
</script>
</body>
</html>
Auf der Webseite funktioniert es. Hier kommen 2 Fehlermeldung
Laden fehlgeschlagen und Type error