1.导入相应的JS类库:
. 代码如下:
<script src="https://code.jquery.com/jquery-1.9.1.js"></script>
<script src="https://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
. 代码如下:
<p id="draggable">
<p>Drag me around!</p>
</p>
. 代码如下:
#draggable {
width:150px;
height:150px;
padding:0.5em;
border:1px solid;
}
. 代码如下:
<script>
$(function() {
$('#draggable').draggable();
});
</script>
. 代码如下:
<!-- import the necessary files -->
<script src="https://code.jquery.com/jquery-1.9.1.js"></script>
<script src="https://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script>
$(function() {
$('#draggable').draggable();
});
</script>
<style>
#draggable {
width:150px;
height:150px;
padding:0.5em;
border:1px solid;
}
</style>
<p id="draggable">
<p>Drag me around!</p>
</p>
如对本文有疑问, 点击进行留言回复!!
【第138期】 游戏策划:应聘前HR要求把游戏玩到30级,怎么玩?
网友评论