마우스따라 움직이는 툴팁 > script

본문 바로가기
사이트 내 전체검색

script

마우스따라 움직이는 툴팁

페이지 정보

작성자 서방님 댓글 0건 조회 166회 작성일 06-09-12 17:12

본문

<script language="JavaScript">
<!--
function showTipText(text, bg, width) {
     tooltip.innerText = text;
     tooltip.style.background = bg;
     tooltip.style.display = "inline";
      tooltip.style.width = width;

}

function showTipHtml(tag, bg, width) {
    try
    {
        tooltip.innerHTML = tag;
        tooltip.style.background = bg;
        tooltip.style.display = "inline";
        tooltip.style.width = width;
     }catch(e){}
}

function hideTip() {
     tooltip.style.display = "none";
}
function moveTip() {
     tooltip.style.pixelTop = event.y + document.body.scrollTop + 5;
     tooltip.style.pixelLeft = event.x + document.body.scrollLeft - 50;
}

document.write("<style>");
document.write("#tooltip { ");
document.write("        VISIBILITY:visible;position:absolute; top:5; left:5; border:solid 1 #777777; background:#ffffff; color:#555555; font-size:9pt; font-family:verdana;");
document.write("        padding:7; overflow:hidden; z-index:99999; display:none; ");
document.write("    } ");
document.write("</style>");

document.write("<div id='tooltip'></div>");
document.onmousemove = moveTip;

// 사용할때는

// onmouseover="showTipHtml('내용','#ffffff',300);"

// onmouseout="hideTip();"

// HTML태그가 아닌 단순 텍스트만 사용한다면...

//onmouseover="showTipText('내용','#ffffff',300);" 사용

//-->
</script>

댓글목록

등록된 댓글이 없습니다.

Total 846건 54 페이지
게시물 검색

회원로그인

접속자집계

오늘
123
어제
225
최대
1,347
전체
154,882
Latest Crypto Fear & Greed Index

그누보드5
Copyright © 서방님.kr All rights reserved.