2008-12-13 09:53:02 +00:00
|
|
|
<!doctype html>
|
|
|
|
<html lang="en">
|
2008-12-05 20:19:46 +00:00
|
|
|
<head>
|
2008-12-13 09:53:02 +00:00
|
|
|
<title>Draggable Scroll Tests</title>
|
2009-01-22 12:01:20 +00:00
|
|
|
<link rel="stylesheet" href="../all.css" type="text/css">
|
|
|
|
<link rel="stylesheet" href="../../../themes/base/ui.all.css" type="text/css">
|
2009-02-20 11:40:25 +00:00
|
|
|
<script type="text/javascript" src="../../../jquery-1.3.2.js"></script>
|
2009-01-22 12:01:20 +00:00
|
|
|
<script type="text/javascript" src="../../../ui/ui.core.js"></script>
|
|
|
|
<script type="text/javascript" src="../../../ui/ui.draggable.js"></script>
|
|
|
|
<script type="text/javascript" src="../../../ui/ui.sortable.js"></script>
|
2008-12-13 09:53:02 +00:00
|
|
|
<style type="text/css">
|
|
|
|
.draggable {
|
|
|
|
width:100px;
|
|
|
|
height:100px;
|
|
|
|
background-color:green;
|
|
|
|
color: #fff;
|
|
|
|
padding: 5px;
|
|
|
|
margin: 5px;
|
|
|
|
border: 5px solid red;
|
|
|
|
}
|
|
|
|
.container {
|
|
|
|
width: 500px;
|
|
|
|
height: 200px;
|
|
|
|
border: 5px solid black;
|
|
|
|
padding: 5px;
|
|
|
|
margin: 5px;
|
|
|
|
float: left;
|
|
|
|
background: #fff;
|
|
|
|
}
|
|
|
|
.enlarge {
|
|
|
|
width: 1000px;
|
|
|
|
height: 1000px;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<script type="text/javascript">
|
2008-12-05 20:19:46 +00:00
|
|
|
$(function(){
|
|
|
|
$(".draggable").draggable({
|
|
|
|
//helper: 'clone',
|
|
|
|
drag: function(e, ui) {
|
|
|
|
//console.log(ui.helper.offset());
|
|
|
|
},
|
|
|
|
scroll:true
|
|
|
|
//containment:"parent"
|
|
|
|
});
|
|
|
|
});
|
2008-12-13 09:53:02 +00:00
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
2008-12-05 20:19:46 +00:00
|
|
|
|
2008-12-30 10:05:51 +00:00
|
|
|
<div class='draggable' style='z-index: 1000;'>Simple draggable</div>
|
|
|
|
<br clear='both' />
|
|
|
|
|
|
|
|
|
2008-12-05 20:19:46 +00:00
|
|
|
<div class='container' style="overflow:scroll;">
|
|
|
|
<div class='draggable'>(Broken in IE)</div>
|
|
|
|
<div class='enlarge'></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class='container' style="overflow:scroll; position: relative;">
|
|
|
|
<div class='draggable'></div>
|
|
|
|
<div class='enlarge'></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class='container' style="overflow:scroll;">
|
|
|
|
<div class='draggable' style='position: absolute;top:0px;left:1000px;'>Absolute</div>
|
|
|
|
<div class='enlarge'></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class='container' style="overflow:scroll; position: relative;">
|
|
|
|
<div class='draggable' style='position: absolute;'>Absolute</div>
|
|
|
|
<div class='enlarge'></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class='container' style="overflow:scroll;">
|
|
|
|
<div class='draggable' style='position: fixed;'>Fixed</div>
|
|
|
|
<div class='enlarge'></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class='container' style="overflow:scroll; position: relative;">
|
|
|
|
<div class='draggable' style='position: fixed;'>Fixed</div>
|
|
|
|
<div class='enlarge'></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Relative draggable with two containers -->
|
|
|
|
|
|
|
|
<div class='container' style="overflow:scroll; position: relative;">
|
|
|
|
<div class='container'>
|
|
|
|
<div class='draggable'>Relative</div>
|
|
|
|
<div class='enlarge'></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class='container' style="overflow:scroll; position: relative;">
|
|
|
|
<div class='container' style='position: relative;'>
|
|
|
|
<div class='draggable'>Relative</div>
|
|
|
|
<div class='enlarge'></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class='container' style="position: relative;">
|
|
|
|
<div class='container' style='overflow: scroll;'>
|
|
|
|
<div class='draggable'>Relative (Broken in IE)</div>
|
|
|
|
<div class='enlarge'></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class='container' style="position: relative;">
|
|
|
|
<div class='container' style='position: relative; overflow: scroll;'>
|
|
|
|
<div class='draggable'>Relative</div>
|
|
|
|
<div class='enlarge'></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Absolute draggable with two containers -->
|
|
|
|
|
|
|
|
<div class='container' style="overflow:scroll; position: relative;">
|
|
|
|
<div class='container'>
|
|
|
|
<div class='draggable' style='position: absolute;'>Absolute</div>
|
|
|
|
<div class='enlarge'></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class='container' style="overflow:scroll; position: relative;">
|
|
|
|
<div class='container' style='position: relative;'>
|
|
|
|
<div class='draggable' style='position: absolute;'>Absolute</div>
|
|
|
|
<div class='enlarge'></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class='container' style="position: relative;">
|
|
|
|
<div class='container' style='overflow: scroll;'>
|
|
|
|
<div class='draggable' style='position: absolute;top:0px;left:0px;'>Absolute</div>
|
|
|
|
<div class='enlarge'></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class='container' style="position: relative;">
|
|
|
|
<div class='container' style='position: relative; overflow: scroll;'>
|
|
|
|
<div class='draggable' style='position: absolute;'>Absolute</div>
|
|
|
|
<div class='enlarge'></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|