0
|
1 <!DOCTYPE html>
|
|
2 <html lang="en">
|
|
3 <head>
|
|
4 <meta charset="utf-8">
|
|
5 <title>jQuery UI Droppable - Default functionality</title>
|
|
6 <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
|
|
7 <script src="../../jquery-1.5.1.js"></script>
|
|
8 <script src="../../ui/jquery.ui.core.js"></script>
|
|
9 <script src="../../ui/jquery.ui.widget.js"></script>
|
|
10 <script src="../../ui/jquery.ui.mouse.js"></script>
|
|
11 <script src="../../ui/jquery.ui.draggable.js"></script>
|
|
12 <script src="../../ui/jquery.ui.droppable.js"></script>
|
|
13 <link rel="stylesheet" href="../demos.css">
|
|
14 <style>
|
|
15 #draggable { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 10px 10px 10px 0; }
|
|
16 #droppable { width: 150px; height: 150px; padding: 0.5em; float: left; margin: 10px; }
|
|
17 </style>
|
|
18 <script>
|
|
19 $(function() {
|
|
20 $( "#draggable" ).draggable();
|
|
21 $( "#droppable" ).droppable({
|
|
22 drop: function( event, ui ) {
|
|
23 $( this )
|
|
24 .addClass( "ui-state-highlight" )
|
|
25 .find( "p" )
|
|
26 .html( "Dropped!" );
|
|
27 }
|
|
28 });
|
|
29 });
|
|
30 </script>
|
|
31 </head>
|
|
32 <body>
|
|
33
|
|
34 <div class="demo">
|
|
35
|
|
36 <div id="draggable" class="ui-widget-content">
|
|
37 <p>Drag me to my target</p>
|
|
38 </div>
|
|
39
|
|
40 <div id="droppable" class="ui-widget-header">
|
|
41 <p>Drop here</p>
|
|
42 </div>
|
|
43
|
|
44 </div><!-- End demo -->
|
|
45
|
|
46
|
|
47
|
|
48 <div class="demo-description">
|
|
49 <p>Enable any DOM element to be droppable, a target for draggable elements.</p>
|
|
50 </div><!-- End demo-description -->
|
|
51
|
|
52 </body>
|
|
53 </html>
|