Loading ...
Sorry, an error occurred while loading the content.

Q Regarding Drag and Drop

Expand Messages
  • preetha_a
    Hi, This is with a very simple example using the java.util.DD. I am trying to override the startDrag method and I get the error dragElementDD has no
    Message 1 of 1 , Apr 3, 2006
    • 0 Attachment
      Hi,
      This is with a very simple example using the java.util.DD. I am trying
      to override the startDrag method and I get the error "dragElementDD
      has no properties".

      <?xml version="1.0" encoding="ISO-8859-1" ?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>

      <meta http-equiv="Content-Type" content="text/html;
      charset=ISO-8859-1" />
      <script type="text/javascript" src="js/YAHOO.js"></script>

      <script type="text/javascript" src="js/event.js"></script>
      <script type="text/javascript" src="js/dom.js"></script>
      <script type="text/javascript" src="js/dragdrop.js"></script>

      <script type="text/javascript" language="Javascript">
      // global variables
      var dragElementDD;
      var dragElementDDProxy;

      function init() {
      dragElementDD = new YAHOO.util.DD("dragDropDivDD");
      dragElementDDProxy = new YAHOO.util.DDProxy("dragDropDivDDProxy");
      }
      YAHOO.util.Event.addListener(window, 'load', init);
      </script>
      <style type="text/css">
      .dragDiv {
      position: relative;
      width: 50px;
      height: 50px;
      background-color: #00FF00;
      cursor: move;
      }
      </style>
      </head>

      <body>

      <div style="height:20px"> </div>

      <div id="dragDropDivDD" class="dragDiv">
      Drag Drop 1
      </div>
      <br/>

      <div id="dragDropDivDDProxy" class="dragDiv">
      Drag Drop 2
      </div>
      <script type="text/javascript" language="Javascript">
      dragElementDD.startDrag = function(x, y) {
      alert("drag started at"+x+" "+y);
      };
      </script>

      </body>

      Is there something basic that is going wrong here?
    Your message has been successfully submitted and would be delivered to recipients shortly.