源码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>html5拖拽效果</title>
<style>
#d1 {
width: 400px;
height: 400px;
border: solid black 1px;
float: left;;
}
#d2 {
width: 400px;
height: 400px;
border: solid black 1px;
float: right;;
}
</style>
</head>
<body>
<div );
div1.removeChild(myImage);//实现将源元素(图片)移到目标元素,而原来的源元素(图片)消失的效果
}
</script>
效果图:
移动前:
移动后: