제목 : jQuery UI의 Drag & Drop 기능
글번호:
|
|
5
|
작성자:
|
|
Administrator ( 레드플러스 / redplus@live.com )
|
작성일:
|
|
2012/05/15 오전 5:58:01
|
조회수:
|
|
7931
|
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="utf-8" />
<title>Drag & Drop</title>
<style type="text/css">
.product { width:100px; height:100px; border:1px solid red; display:inline-block; }
#theDrop { width:200px; height:200px; border:1px solid red; }
</style>
<script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="../js/jquery-ui-1.8.18.custom.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('#theDrags').children().draggable(); // 드래그 가능 요소
//$('#theDrop').droppable(); // 드롭 가능 요소
$('#theDrop').droppable({
drop: function (event, ui) {
ui.draggable.hide("explode", "slow");
}
});
});
</script>
</head>
<body>
<h1>jQuery UI Interactions</h1>
<h3>Drag & Drop</h3>
<div id="theDrags">
<div class="product">상품1</div>
<div class="product">상품2</div>
<div class="product">상품3</div>
</div>
<div id="theDrop">
장바구니
</div>
</body>
</html>