Cet article décrit l'effet de fenêtre rapide contextuel de JS dans le coin inférieur droit. Partagez-le pour votre référence, comme suit:
<! 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"> <éad> <meta http-equiv = "contenu-type" content = "text / html; charset = utf-8" /> <t titre> aa </ title> <style type = "text / css"> * {margin: 0px; rembourrage: 0px; } html, corps {hauteur: 100%; } corps {taille de police: 14px; hauteur de ligne: 24px; } #tip {position: absolue; Droite: 0px; En bas: 0px; hauteur: 0px; Largeur: 180px; Border: 1px solide #cccccc; Color d'arrière-plan: #eeeeee; rembourrage: 1px; débordement: caché; Affichage: aucun; taille de police: 12px; Z-Index: 10; } #tip p {padding: 6px; } #tip h1 {Font-Size: 14px; hauteur: 25px; hauteur de ligne: 25px; Color d'arrière-plan: # 0066cc; Couleur: #FFFFF; rembourrage: 0px 3px 0px 3px; filtre: alpha (opacité = 100); } #tip h1 a, #detail h1 a {float: droit; Décoration du texte: aucune; Couleur: #FFFFF; } </ style> <script type = "text / javascript"> window.onload = function () {var divtip = document.createElement ("div"); divtip.id = "TIP"; divtip.innerhtml = "<h1> <a href = 'javascript: void (0)' onClick = 'start ()'> close </a> title </h1> <p> <a href = 'javascript: void (0)' onclick = 'showwin ()'> contenu </a> </p>"; divtip.style.height = '0px'; divtip.style.bottom = '0px'; divtip.style.position = 'fixe'; Document.Body.ApendChild (Divtip); } var manche; fonction start (count) {var obj = document.getElementById ("TIP"); if (parseInt (obj.style.height) == 0) {obj.style.display = "block"; handle = setInterval ("changeh ('up')", 20); } else {handle = setInterval ("changeh ('down')", 20)}} fonction changeh (str) {var obj = document.all? Document.all ["Tip"]: document.getElementById ("Tip"); //docuemnt.all ??????? if (str == "up") {if (parseInt (obj.style.height)> 100) clearInterval (handle); else obj.style.height = (parseInt (obj.style.height) + 8) .ToString () + "px"; } if (str == "down") {if (parseInt (obj.style.height) <8) {ClearInterval (manche); obj.style.display = "Aucun"; } else obj.style.height = (parseInt (obj.style.height) - 8) .ToString () + "px"; }} fonction showwin () {//document.getElementsByTagname("html") 00.style.overflow = "Hidden"; commencer(); } </ script> </ head> <body> <a href = "#" onclick = "start ()"> cliquez </a> </body> </html>Pour plus d'informations sur le contenu lié à JavaScript, veuillez consulter les sujets de ce site: "Résumé des effets et techniques de commutation JavaScript", "Résumé des effets et techniques de recherche JavaScript", "Résumé des erreurs Javascript et des techniques de débogage" Algorithmes et techniques de traversée JavaScript ", et" Résumé de l'utilisation des opérations mathématiques JavaScript "
J'espère que cet article sera utile à la programmation JavaScript de tous.