【HTML】
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>jQuery Sample</title>
<link rel="stylesheet" href="css/main.css" type="text/css" media="all">
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/ui/ui.mouse.js"></script>
<script type="text/javascript" src="js/ui/ui.draggable.js"></script>
<script type="text/javascript" src="js/ui/ui.draggable.ext.js"></script>
<script type="text/javascript" src="js/main.js"></script>
</head>
<body>
<h1>jQueryサンプル</h1>
<p>jQuery UIの処理</p>
<div id="myArea">ここがドラッグできます</div>
</body>
</html>
【CSS】
h1 {
font-size:14pt;
border-bottom:1px dotted gray;
width:320px;
}
#myArea {
background-color:yellow;
width:240px;
height:160px;
}
【JavaScript】
$(function(){
$("#myArea").draggable();
});
【HTML】
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>jQuery Sample</title>
<link rel="stylesheet" href="css/main.css" type="text/css" media="all">
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/ui/ui.mouse.js"></script>
<script type="text/javascript" src="js/ui/ui.draggable.js"></script>
<script type="text/javascript" src="js/ui/ui.draggable.ext.js"></script>
<script type="text/javascript" src="js/main.js"></script>
</head>
<body>
<h1>jQueryサンプル</h1>
<p>jQuery UIの処理</p>
<div class="dArea">(1) ここがドラッグできます</div>
<div class="dArea">(2) ここがドラッグできます</div>
<div class="dArea">(3) ここがドラッグできます</div>
<div class="dArea">(4) ここがドラッグできます</div>
</body>
</html>
【CSS】
h1 {
font-size:14pt;
border-bottom:1px dotted gray;
width:320px;
}
.dArea {
background-color:yellow;
width:120px;
height:100px;
}
【JavaScript】
$(function(){
$(".dArea").draggable();
});