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
|
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<style>
html{overflow:hidden;}
#contener{margin: 0 auto;width:1000px;height:800px;background-color:#555;}
#gauche{width:500px;height:400px;display:inline-block;background-color:#CAE;}
#droit{position:relative;top:-400px!important;left:500px;width:500px;height:400px;background-color:#FA2;}
.moveable{position:relative;width: 150px; height: 50px; padding: 0.5em;background-color:#AEF;border:1px solid #000;margin: 2px 2px;z-index:1000;}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
<script>
$(document).ready(function () {
$( ".moveable" ).draggable({
opacity: 0.35,
scroll: false,
start: function(event, ui) { $(this).html("start");},
drag: function(event, ui) {$(this).html("element moving");},
stop: function(event, ui) {$(this).html("element stop");}
});
});
</script>
</head>
<body>
<div id="contener">
<div id="gauche">
<div class="moveable">box1</div>
<div class="moveable">box2</div>
<div class="moveable">box3</div>
</div>
<div id="droit">
</div>
</div>
</body>
</html> |