< xmlns = "http://www.w3.org/1999/xhtml"> <fead> <meta http-equiv = "content-type" content = "text/html; charset = utf-8"/> <title> Untitled 1 </title> <style type = "text/css"> .Style1 {{{{{<title> untitled 1 </title> <style type = "text/css"> .Style1 {{{{{<ttitle> Untitled 1 </title> <style type = "text/css"> .Style1 {{{{smtyle; } </style> <script type = "text/javaScript">/** Puntos de dibujo*/function makedot (x, y) {pointDiv = "<div style = 'Height: 1px; posicion: Absolute; Left:" + x + "px; top:" + y + "px; width: 1px; fondo:#f00; overflow: hidden'> <div>"; return PointDiv;} /** Dibuje una línea recta basada en las coordenadas de los dos puntos. */ línea de funciones (x1, y1, x2, y2) {var pendiente; // Slope var direction; // coordinar movimiento var tx = x2 - x1; var ty = y2 - y1; if (tx == 0 && ty == 0) return; Var Points = ""; var eje; // coordina en el eje if (math.abs (tx)> = math.abs (ty)) {// mude direction = tx> 0? 1: -1; tx = math.abs (tx); pendiente = ty / tx; eje = x1; para (i = 0; i <tx; i ++) {puntos += makedot (eje, y1 +i * pendiente); eje += dirección; }} else {// mover la dirección en la dirección del eje y = ty> 0? 1: -1; ty = math.abs (ty); pendiente = tx / ty; eje = y1; para (i = 0; i <ty; i ++) {puntos += makedot (x1 +i * pendiente, eje); eje += dirección; }} var contenedor = document.getElementById ("contenedor"); contenedor.innerhtml += puntos; } var OldPoint = null; // Obtener la función de posición del mouse mousePosition (ev) {ev = ev || Window.event; if (ev.pagex || ev.pagey) {return {x: ev.pagex, y: ev.pagey}; } var doc = document.documentelement, body = document.body; var pagex = event.clientx + (doc && doc.scrollleft || body && body.scrollleft || 0) - (doc && doc.clientleft || body && body.clientleft || 0); var pagey = event.clienty + (doc && doc.scrolltop || body && body.scrolltop || 0) - (doc && doc.clienttop || body && body.clienttop || 0); return {x: pagex, y: pagey};} function RecordPoint (ev) {var punto = mousePosition (ev); if (OldPoint! = NULL) {line (OldPoint.x, OldPoint.y, Point.x, Point.y); } OldPoint = Point;} </script> </head> <body> <div id = "Container" onClick = "RecordPoint (evento);"> </div> <script type = "text/javaScript"> // line (19,19,22,300); </script> </body> </html>