1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
<html>
<head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<style type="text/css">
<meta charset="utf-8">
<style>
.draggable { width: 150px; height: 90px; padding: 0.5em; float: left; margin: 0 10px 10px 0; }
#containment1-wrapper { width: 500px; height:150px; border:2px solid #ccc; padding: 10px; margin-bottom: 30px }
#draggable1 { width: 80px; height:50px; border:2px solid #ccc; padding: 10px; background:grey}
#containment2-wrapper { width: 500px; height:150px; border:2px solid #ccc; padding: 10px; }
#draggable3 { width: 70px; height:50px; border:2px solid #ccc; }
#rectangle
{
position: relative;
display: block;
width: 512px;
height: 48px;
padding: 8px;
color: #fff;
background-color: rgb(144,96,128);
}
</style>
<script>
$(function() {
$( "#draggable1" ).draggable({ containment: "#containment1-wrapper", scroll: false });
$( "#draggable3" ).draggable({ containment: "#containment-wrapper", scroll: false });
});
</script>
<div class="demo">
<h3 class="docs">test drag and drop</h3>
<div id="containment1-wrapper">
<div id="draggable1" class="draggable ui-widget-content">
<p>drag dans box1</p>
</div>
</div>
<div id="containment-wrapper">
<div id="draggable3" class="draggable ui-widget-content">
<p>drag dans box3</p>
</div>
</div>
</div><
</body>
</html> |