How to use html5 to realize jigsaw puzzle
This article focuses on "how to use html5 to achieve jigsaw puzzles", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to use html5 to achieve jigsaw puzzles.
The specific code is as follows:
Drag drag .box {float: left;} img {width: 150px; height:150px;} # puzzle {font-size: 0; margin:80px auto; padding: 5px; width: 460px;}
Var image = document.getElementsByTagName ("img"); var box = document.getElementsByClassName ("box"); image.draggable = true; var source = ""; var nowImage; var nowImageBox; var thenImage; for (let item0)