blob: c7593091f031a4491702acb391641d603cd224d3 (
plain)
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
<!doctype html>
<html lang="en">
<head>
<title>Draggable Scroll Tests</title>
<link rel="stylesheet" href="../all.css" type="text/css">
<link rel="stylesheet" href="../../../themes/base/ui.all.css" type="text/css">
<script type="text/javascript" src="../../../jquery-1.4.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.mouse.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.draggable.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.sortable.js"></script>
<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">
$(function(){
$(".draggable").draggable({
//helper: 'clone',
drag: function(e, ui) {
//console.log(ui.helper.offset());
},
scroll:true
//containment:"parent"
});
});
</script>
</head>
<body>
<div class='draggable' style='z-index: 1000;'>Simple draggable</div>
<br clear='both' />
<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>
|