/[projects]/misc/horsensspejder-web/jquery/jquery-ui-1.10.3/demos/droppable/accepted-elements.html
ViewVC logotype

Contents of /misc/horsensspejder-web/jquery/jquery-ui-1.10.3/demos/droppable/accepted-elements.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2125 - (show annotations) (download) (as text)
Wed Mar 12 19:30:05 2014 UTC (10 years, 2 months ago) by torben
File MIME type: text/html
File size: 1603 byte(s)
initial import
1 <!doctype html>
2 <html lang="en">
3 <head>
4 <meta charset="utf-8">
5 <title>jQuery UI Droppable - Accept</title>
6 <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
7 <script src="../../jquery-1.9.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 #droppable { width: 150px; height: 150px; padding: 0.5em; float: left; margin: 10px; }
16 #draggable, #draggable-nonvalid { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 10px 10px 10px 0; }
17 </style>
18 <script>
19 $(function() {
20 $( "#draggable, #draggable-nonvalid" ).draggable();
21 $( "#droppable" ).droppable({
22 accept: "#draggable",
23 activeClass: "ui-state-hover",
24 hoverClass: "ui-state-active",
25 drop: function( event, ui ) {
26 $( this )
27 .addClass( "ui-state-highlight" )
28 .find( "p" )
29 .html( "Dropped!" );
30 }
31 });
32 });
33 </script>
34 </head>
35 <body>
36
37 <div id="draggable-nonvalid" class="ui-widget-content">
38 <p>I'm draggable but can't be dropped</p>
39 </div>
40
41 <div id="draggable" class="ui-widget-content">
42 <p>Drag me to my target</p>
43 </div>
44
45 <div id="droppable" class="ui-widget-header">
46 <p>accept: '#draggable'</p>
47 </div>
48
49 <div class="demo-description">
50 <p>Specify using the <code>accept</code> option which element (or group of elements) is accepted by the target droppable.</p>
51 </div>
52 </body>
53 </html>

  ViewVC Help
Powered by ViewVC 1.1.20