Dieser Artikel beschreibt den einfachen Popup-Eingabeaufforderungsfenster von JS in der unteren rechten Ecke. Teilen Sie es für Ihre Referenz wie folgt weiter:
<! 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> aa </title> <style type = "text/css"> * {{{ardg; Polsterung: 0px; } html, Körper {Höhe: 100%; } Body {Schriftgröße: 14px; Zeilenhöhe: 24px; } #tip {Position: absolut; Rechts: 0px; unten: 0px; Höhe: 0px; Breite: 180px; Grenze: 1PX Solid #CCCCC; Hintergrundfarbe: #eeeeeee; Polsterung: 1PX; Überlauf: versteckt; Anzeige: Keine; Schriftgröße: 12px; Z-Index: 10; } #tip p {padding: 6px; } #tip H1 {Schriftgröße: 14px; Höhe: 25px; Zeilenhöhe: 25px; Hintergrundfarbe: #0066cc; Farbe: #fffff; Polsterung: 0px 3px 0px 3px; Filter: Alpha (Opazität = 100); } #tip h1 a, #Detail H1 a {float: rechts; Textdekoration: Keine; Farbe: #fffff; } </style> <script type = "text/javaScript"> window.onload = function () {var divtip = document.createelement ("div"); divtip.id = "tip"; divtip.innnerhtml = "<h1> <a href = 'javaScript: void (0)' onclick = 'start ()'> close </a> title </h1> <p> <a href = 'javaScript: void (0)' onclick = 'showwin ()'> content </a> </p> </p>; divtip.style.height = '0px'; divtip.style.bottom = '0px'; divtip.style.position = 'fix'; document.body.Appendchild (Divtip); } var Handle; Funktion start (count) {var obj = document.getElementById ("Tipp"); if (parseInt (obj.style.height) == 0) {obj.style.display = "block"; Handle = setInterval ("ChangeH ('up')", 20); } else {handle = setInterval ("ChangeH ('Down')", 20)}} Funktion ChangeH (str) {var obj = document.all? document.all ["Tipp"]: document.getElementById ("Tipp"); //docuemnt.all ??????? if (str == "up") {if (parseInt (obj.style.height)> 100) clearInterval (Handle); sonst obj.style.height = (parseInt (obj.style.height) + 8) .toString () + "px"; } if (str == "down") {if (parseInt (obj.style.height) <8) {ClearInterval (Handle); obj.style.display = "none"; } else obj.style.height = (parseInt (obj.style.height) - 8) .toString () + "px"; }} function Showwin () {//document.getElementsByTagName("html") Applow.overflow = "Hidden"; Start(); } </script> </head> <body> <a href = "#" onclick = "start ()"> klicken </a> </body> </html>Weitere Informationen zu javaScriptbezogenen Inhalten finden Sie in den Themen dieser Website: "Zusammenfassung der JavaScript -Switching -Effekte und -Techniken", "Zusammenfassung der Fähigkeiten der JavaScript -Suchalgorithmus", "Zusammenfassung der JavaScript -Animationseffekte und -Techniken", "Zusammenfassung von JavaScript -Fehler und Debugging -Techniken", Summary of Javacript -Daten und Algorith -Fähigkeiten "," Summary of Javacript Data Structures "," Summary of Javacript Data Structures "" "" "" "" "" "" "" "" "" " JavaScript -Traversalalgorithmen und -techniken "und" Zusammenfassung der Nutzung von JavaScript -Mathematischen Operationen "
Ich hoffe, dieser Artikel wird für JavaScript -Programme aller hilfreich sein.