天天看點

圖檔拖拽的繼承,引用 1 (需要引入2,3兩個js才能運作)

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title></title>

<script src="Drag.js"></script>

<script src="LimitDrag.js"></script>

<style>

#box1{ 100px;

height:100px;background-color: #00ee00;position: absolute;}

#box2{ 100px;

height:100px;background-color: red;position: absolute;}

</style>

<script>

window.onload=function(){

new Drag("box1")

new LimitDrag("box2")

}

</script>

</head>

<body>

<div id="box1"></div>

<div id="box2"></div>

</body>

</html>