<! DocType html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transsitional.dtd"> <html xmlns = "http://www.w3.org/1999/xhtml"> <head> <meta http-equiv = "content-type" content = "text/html; charset = utf-8"/> <title> rotdled 1 </title> <style type = " } </style> <script type = "text/javaScript">/** Punkte zeichnen Rückgabe pointdiv;} /** Zeichnen Sie eine gerade Linie basierend auf den Koordinaten der beiden Punkte. */ Funktionslinie (x1, y1, x2, y2) {var Slope; // Steigungsvarrichtung; // Koordinatenbewegung var tx = x2 - x1; var ty = y2 - y1; if (tx == 0 && ty == 0) return; var points = ""; var axis; // Koordinaten auf der Achse if (math.abs (tx)> = math.abs (ty)) {// Move Direction = Tx> 0? 1: -1; tx = math.abs (tx); Steigung = ty / tx; Achse = x1; für (i = 0; i <tx; i ++) {Punkte += Makedot (Achse, y1 +i * Slope); Achse += Richtung; }} else {// Die Richtung auf der y-achse Direction = ty> 0? 1: -1; ty = math.abs (ty); Steigung = TX / TY; Achse = y1; für (i = 0; i <ty; i ++) {Punkte += Makedot (x1 +i * Steigung, Achse); Achse += Richtung; }} var container = document.getElementById ("Container"); Container.InnerHtml += Punkte; } var oldpoint = null; // Die Maus -Positionsfunktion Mouseposition (ev) {ev = ev || Fenster.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 point = mouseposition (ev); if (oldPoint! } oldPoint = point;} </script> </head> <body> <div id = "container" onclick = "recordPoint (Ereignis);"> </div> <script type = "text/javaScript"> // Zeile (19,19,22,300); </script> </body> </html>