Advertisement
bugg94

test

Sep 18th, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.66 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
  3. <head>
  4.   <title>exercice en Javascript 1</title>
  5.   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  6.   <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
  7.   <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
  8.   <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
  9.   <link rel="stylesheet" href="/resources/demos/style.css" />
  10.    <style>
  11.     #drag {width: 50px; height: 50px; padding: 3em; float: left; margin: 50px 60px 70px 0; }
  12.     #draggable { width: 100px; height: 100px; padding: 1.5em; float: left; margin: 10px 10px 10px 0; }
  13.     #droppable { width: 150px; height: 150px; padding: 0.5em; float: left; margin: 10px; }
  14.     </style>
  15.     <script>
  16.      $(function() {
  17.         $("#drag").draggable({containment:'parent'});
  18.         $( "#draggable" ).draggable({containment:'parent'});
  19.         $( "#droppable" ).droppable({
  20.             accept:"#drag",
  21.             drop: function( event, ui ) {
  22.             ui.draggable.appendTo($( this ))
  23.             .addClass( "ui-state-highlight" )
  24.             .draggable({containment: 'parent'})
  25.             .find( "p" )
  26.                 .html( "Dropped!" );
  27. }
  28. /*fin de droppable */
  29. });
  30. /*fin de function */
  31. });
  32.     </script>
  33. </head>
  34. <body>
  35. <div id="drag" class="ui-widget-content">
  36. <p>yop</p>
  37. </div>
  38.     <div id="draggable" class="ui-widget-content">
  39. <p>bouge moi !</p>
  40. </div>
  41. <div id="droppable" class="ui-widget-header">
  42. <p>Drop here</p>
  43.  
  44. </div>
  45. </body>
  46. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement