很多前端恐怕都不了解html5的拖拽怎么实现吧,本文了解了下思路。进行整理备份,便于以后查阅。
先上示例:
index.html
- nbsp;html>
- html>
- head>
- meta charset="UTF-8">
- title>Dragtitle>
- style>
- .box{
- width: 400px;
- height: 400px;
- float: left;
- }
- #box1{
- background: #CCC;
- }
- #box2{
- background: #FF0;
- }
- style>
- head>
- body>
- div id="box1" class="box">div>
- div id="box2" class="box">div>
- img src="http://pica.zol-img.com.cn/2016/02/1ace90ad77db716547614a18c4a9263g.jpg" alt="" id="img1" />
- >











