issue2_test.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?xml version="1.0" standalone="no"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg">
  4. <head>
  5. <!--
  6. test page for issue 2. jsPlumb should not throw an error if dragging is not available (ie. jQuery UI
  7. has not been included), even if the user asks for dragging.
  8. -->
  9. <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
  10. <title>jsPlumb testing</title>
  11. <script type="text/javascript" src="http://explorercanvas.googlecode.com/svn/trunk/excanvas.js"></script>
  12. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  13. <script type="text/javascript" src="../js/jquery.jsPlumb-1.0.3-RC1.js"></script>
  14. <style>
  15. .box { padding: 5em; border: 1px solid red}
  16. #first { position:absolute; left:40%; }
  17. #third { position:absolute; left:60%; top:10em; }
  18. #second { position:absolute; left:20%;top:10em; }
  19. </style>
  20. </head>
  21. <body onunload="jsPlumb.unload();">
  22. <div>
  23. <div class="box" id = "first" >A</div>
  24. <div class="box" id = "second">B</div>
  25. <div class="box" id = "third">C</div>
  26. </div>
  27. </body>
  28. <script>
  29. $( document ).ready( function() {
  30. $( "#second" ).plumb( {
  31. target: "first",
  32. draggable:true,
  33. anchors:[ jsPlumb.Anchors.RightMiddle, jsPlumb.Anchors.BottomCenter ]
  34. } );
  35. $( "#third" ).plumb( {
  36. target: "first",
  37. draggable:true,
  38. anchors:[ jsPlumb.Anchors.LeftMiddle, jsPlumb.Anchors.BottomCenter ]
  39. } );
  40. } )
  41. </script>
  42. </html>