diff options
author | Scott González <scott.gonzalez@gmail.com> | 2010-09-10 09:38:42 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2010-09-10 09:38:42 -0400 |
commit | a1fc59c17e40b89c28920681cd6dd32ed68a4102 (patch) | |
tree | 3c1ddd977d1524775f48eef1b361d085b04bf7eb /demos/droppable/accepted-elements.html | |
parent | 6cf45dd25a98f98c91a4000345fc5597f9929939 (diff) | |
download | jquery-ui-a1fc59c17e40b89c28920681cd6dd32ed68a4102.tar.gz jquery-ui-a1fc59c17e40b89c28920681cd6dd32ed68a4102.zip |
Droppable demos: Coding standards.
Diffstat (limited to 'demos/droppable/accepted-elements.html')
-rw-r--r-- | demos/droppable/accepted-elements.html | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/demos/droppable/accepted-elements.html b/demos/droppable/accepted-elements.html index 0ba0207e3..455e075e0 100644 --- a/demos/droppable/accepted-elements.html +++ b/demos/droppable/accepted-elements.html @@ -1,38 +1,39 @@ <!DOCTYPE html> <html lang="en"> <head> - <meta charset="UTF-8" /> - <title>jQuery UI Droppable - Accept Demo</title> - <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" /> - <script type="text/javascript" src="../../jquery-1.4.2.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.droppable.js"></script> - <link type="text/css" href="../demos.css" rel="stylesheet" /> - <style type="text/css"> + <meta charset="utf-8"> + <title>jQuery UI Droppable - Accept</title> + <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css"> + <script src="../../jquery-1.4.2.js"></script> + <script src="../../ui/jquery.ui.core.js"></script> + <script src="../../ui/jquery.ui.widget.js"></script> + <script src="../../ui/jquery.ui.mouse.js"></script> + <script src="../../ui/jquery.ui.draggable.js"></script> + <script src="../../ui/jquery.ui.droppable.js"></script> + <link rel="stylesheet" href="../demos.css"> + <style> #droppable { width: 150px; height: 150px; padding: 0.5em; float: left; margin: 10px; } #draggable, #draggable-nonvalid { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 10px 10px 10px 0; } </style> - <script type="text/javascript"> + <script> $(function() { - - $("#draggable, #draggable-nonvalid").draggable(); - - $("#droppable").droppable({ - accept: '#draggable', - activeClass: 'ui-state-hover', - hoverClass: 'ui-state-active', - drop: function(event, ui) { - $(this).addClass('ui-state-highlight').find('p').html('Dropped!'); + $( "#draggable, #draggable-nonvalid" ).draggable(); + $( "#droppable" ).droppable({ + accept: "#draggable", + activeClass: "ui-state-hover", + hoverClass: "ui-state-active", + drop: function( event, ui ) { + $( this ) + .addClass( "ui-state-highlight" ) + .find( "p" ) + .html( "Dropped!" ); } }); - }); </script> </head> <body> + <div class="demo"> <div id="draggable-nonvalid" class="ui-widget-content"> @@ -49,10 +50,11 @@ </div><!-- End demo --> -<div class="demo-description"> -<p>Specify using the <code>accept</code> option which element (or group of elements) is accepted by the target droppable.</p> +<div class="demo-description"> +<p>Specify using the <code>accept</code> option which element (or group of elements) is accepted by the target droppable.</p> </div><!-- End demo-description --> + </body> </html> |