이 기사에서는 JS가 그림에 맴돌 때 텍스트 설명을 스크롤하는 방법에 대해 설명합니다. 참조를 위해 공유하십시오. 특정 구현 방법은 다음과 같습니다.
다음과 같이 코드를 복사하십시오. <html>
<title> js는 그림에 호버링 할 때 텍스트 설명을 스크롤하는 것을 구현합니다 </title>
<body>
<script language = "javaScript">
<!- 시작
함수 showtip2 (현재, e, 텍스트) {
if (document.all && document.readystate == "complete") {
document.all.tooltip2.innerhtml = '<marquee style = "테두리 : 1px solid black">'+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 = "Visible"
}
else 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"
}
}
함수 hideetip2 () {
if (document.all)
document.all.tooltip2.style.visibility = "Hidden"
else if (document.layers) {
ClearInterval (Currentscroll)
document.tooltip2.visibility = "숨겨진"
}
}
// 종료 ->
</스크립트>
<div id = "ToolTip2"Style = "위치 : 절대; 가시성 : 숨겨진; 클립 : rect (0 150 50 0); 너비 : 150px; 배경색 : 금; z- 안덱 : 10"> </div
<div align = "center"name = "divtest"onmouseover = "showtip2 (this, event, 'wulin.com에 오신 것을 환영합니다');"; onmouseout = "hidetip2 ();" 스타일 = "커서 : 핸드">
<table cellPadding = "0"CellPacing = "0"> <tr> <td colspan = "7">
<img src = "/images/banner.gif"border = "0"style = "커서 : 포인터;"/>
</테이블>
</div>
</body>
</html>
이 기사가 모든 사람의 JavaScript 프로그래밍에 도움이되기를 바랍니다.