1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en" lang=
"en">
5 <title>script.aculo.us Drag and drop functional test file
</title>
6 <meta http-equiv=
"content-type" content=
"text/html; charset=utf-8" />
7 <script type=
"text/javascript" src=
"../../MochiKit/MochiKit.js"></script>
8 <script type=
"text/javascript" src=
"../../MochiKit/Position.js"></script>
9 <script type=
"text/javascript" src=
"../../MochiKit/Visual.js"></script>
10 <script type=
"text/javascript" src=
"../../MochiKit/DragAndDrop.js"></script>
11 <style type=
"text/css" media=
"screen">
12 div.box { background: green; width:
100px; height:
100px }
16 <h1>script.aculo.us Drag and drop functional test file
</h1>
18 <h2>Draggables/Droppables
</h2>
20 <div id=
"box-normal" class=
"box">
24 <div id=
"box-grid-numeric" class=
"box">
28 <div id=
"box-grid-array" class=
"box">
32 <div id=
"box-grid-procedural" class=
"box">
33 snap: procedural (e.g. constrain to box)
36 <script type=
"text/javascript" language=
"javascript" charset=
"utf-8">
38 new MochiKit.DragAndDrop.Draggable('box-normal',{snap:false,revert:true});
39 new MochiKit.DragAndDrop.Draggable('box-grid-numeric',{snap:
25,revert:true});
40 new MochiKit.DragAndDrop.Draggable('box-grid-array',{snap:[
5,
25],revert:true});
41 new MochiKit.DragAndDrop.Draggable('box-grid-procedural',{
44 x
<100 ? (x
> 0 ? x :
0 ) :
100,
45 y
<50 ? (y
> 0 ? y :
0) :
50];