Difference between revisions of "Team:Hong Kong HKUST/Team"

Line 84: Line 84:
 
       </style>
 
       </style>
 
       <script>  
 
       <script>  
           var coorX = 0;
+
           function readMouseMove(event){
          var coorY = 0;
+
              var dot, eventDoc, doc, body, pageX, pageY;
          function readMouseMove(e){
+
 
      coorX = e.clientX-38;
+
        event = event || window.event; // IE-ism
      coorY = e.clientY-114;
+
 
              /*
+
        // If pageX/Y aren't available and clientX/Y are,
              var result_x = document.getElementById('x');
+
        // calculate pageX/Y - logic taken from jQuery.
      var result_y = document.getElementById('y');
+
        // (This is to support old IE)
      result_x.innerHTML = coorX;
+
        if (event.pageX == null && event.clientX != null) {
      result_y.innerHTML = coorY;
+
            eventDoc = (event.target && event.target.ownerDocument) || document;
              */
+
            doc = eventDoc.documentElement;
 +
            body = eventDoc.body;
 +
 
 +
            event.pageX = event.clientX +
 +
              (doc && doc.scrollLeft || body && body.scrollLeft || 0) -
 +
              (doc && doc.clientLeft || body && body.clientLeft || 0);
 +
            event.pageY = event.clientY +
 +
              (doc && doc.scrollTop  || body && body.scrollTop  || 0) -
 +
              (doc && doc.clientTop  || body && body.clientTop  || 0 );
 +
        }
 +
 
 +
 
 
               var modal = document.getElementById('openModal');
 
               var modal = document.getElementById('openModal');
               modal.style.left = coorX+'px';
+
               modal.style.left = event.pageX+'px';
               modal.style.top = coorY+'px';
+
               modal.style.top = event.pageY+'px';
 
           }
 
           }
 
           document.onmousemove = readMouseMove;
 
           document.onmousemove = readMouseMove;

Revision as of 08:13, 30 August 2017

HKUST iGEM Team 2017

Name:

CoorX: CoorY:

Team william Devi Alvin Harold Harold

our advisors


Footer