743a17e8af2578833d21246e653ad5355c072ccc.svn-base 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Dojo parent constraint test</title>
  5. <style type="text/css">
  6. @import "../../resources/dojo.css";
  7. body {
  8. padding: 1em;
  9. }
  10. .moveable {
  11. background: #FFFFBF;
  12. border: 1px solid black;
  13. width: 300px;
  14. padding: 10px 20px;
  15. cursor: pointer;
  16. }
  17. .parent {
  18. background: #BFECFF;
  19. border: 10px solid lightblue;
  20. width: 500px;
  21. height: 500px;
  22. padding: 10px;
  23. margin: 10px;
  24. }
  25. </style>
  26. <script type="text/javascript" src="../../dojo.js" djConfig="isDebug: true"></script>
  27. <script type="text/javascript" src="../../dnd/move.js"></script>
  28. <script type="text/javascript">
  29. dojo.require("dojo.dnd.move");
  30. var m1, m2, m3, m4;
  31. var init = function(){
  32. m1 = new dojo.dnd.move.parentConstrainedMoveable("moveable1", {area: "margin", within: true});
  33. m2 = new dojo.dnd.move.parentConstrainedMoveable("moveable2", {area: "border", within: true});
  34. m3 = new dojo.dnd.move.parentConstrainedMoveable("moveable3", {area: "padding", within: true});
  35. m4 = new dojo.dnd.move.parentConstrainedMoveable("moveable4", {area: "content", within: true});
  36. };
  37. dojo.addOnLoad(init);
  38. </script>
  39. </head>
  40. <body>
  41. <h1>Dojo parent constraint test</h1>
  42. <div class="parent" id="parent">
  43. <div><strong>This is the parent element.</strong> All children will be restricted with <strong>within = true</strong>.</div>
  44. <div class="moveable" id="moveable1">I am restricted within my parent's margins.</div>
  45. <div class="moveable" id="moveable2">I am restricted within my parent's border.</div>
  46. <div class="moveable" id="moveable3">I am restricted within my parent's paddings.</div>
  47. <div class="moveable" id="moveable4">I am restricted within my parent's content.</div>
  48. </div>
  49. </body>
  50. </html>