Dieser Artikel beschreibt die Methode zur Beschreibung der Textbeschreibung, wenn JS auf einem Bild schwebt. Teilen Sie es für Ihre Referenz. Die spezifische Implementierungsmethode lautet wie folgt:
Kopieren Sie den Code wie folgt: <html>
<titels> js implementiert Scrolling -Textbeschreibung, wenn sie auf Bildern schweben </title>
<body>
<Script Language = "JavaScript">
<!- Beginnen Sie
Funktion showtip2 (aktuell, e, text) {
if (document.all && document.readystate == "complete") {
document.all.tooltip2.innerhtml = '<marquee style = "border: 1px solid schwarz">'+text+'</marquee>' '
document.all.tooltip2.Style.pixelleft = event.clientX+document.body.scrollleft+10
document.all.tooltip2.style.pixeltop = event.clienty+document.body.scrolltop+10
document.all.tooltip2.style.visibility = "sichtbar"
}
sonst if (document.layers) {
document.tooltip2.document.nstip.document.write ('<b>'+text+'</b>')
document.tooltip2.document.nstip.document.close ()
document.tooltip2.document.nstip.left = 0
Currentscroll = setInterval ("scrolltip ()", 100)
document.tooltip2.left = e.Pagex+10
document.tooltip2.top = e.pagey+10
document.tooltip2.visibility = "show"
}
}
Funktion hideetip2 () {
if (document.all)
document.all.tooltip2.style.visibility = "Hidden"
sonst if (document.layers) {
ClearInterval (Currentscroll)
document.tooltip2.visibility = "Hidden"
}
}
// Ende ->
</script>
<div id = "tooltip2" style = "Position: absolut; Sichtbarkeit: versteckt; Clip: Rect (0 150 50 0); Breite: 150px; Hintergrundfarbe: Gold; Z-Index: 10"> </div>
<div align = "center" name = "divest" onmouseover = "showtip2 (dieses Ereignis, 'Willkommen bei Wulin.com');" onmouseout = "hidetip2 ();" Style = "Cursor: Hand">
<Table CellPadding = "0" cellpacing = "0"> <tr> <td colspan = "7">
<img src = "/images/banner.gif" border = "0" style = "cursor: pointer;"/>
</Table>
</div>
</body>
</html>
Ich hoffe, dieser Artikel wird für JavaScript -Programme aller hilfreich sein.