마우스 오버시 특정 위치에 내용 보여 주기 > 소스코드

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


회원로그인

소스코드

javascript | 마우스 오버시 특정 위치에 내용 보여 주기

페이지 정보

작성자 100K5 작성일12-04-01 09:35 조회55,354회 댓글0건

본문

<script type="text/javascript">
<!--
var wx;
var wy;
function getIt() {
    wx = window.event.clientX;
    wy = window.event.clientY;
}

function init() {
    document.onmousemove = getIt;
}

function short_msg_show(commend) {
    idw = showmsg.style.pixelWidth;
    clw = document.body.clientWidth;
    idw = clw - idw - 10;

    showmsg.style.pixelLeft = document.body.scrollLeft + wx - 20 + '';
    showmsg.style.pixelTop = document.body.scrollTop + wy + 20 + '';
            
    if (showmsg.style.pixelLeft > idw) {
        showmsg.style.pixelLeft = idw;
    }
 
    sp_commend.innerHTML = "<tr><td>"+commend+"</td></tr>";
    showmsg.style.visibility = "visible";
}

function short_msg_hide() {
    showmsg.style.visibility = "hidden";
}
//-->
</script>


소스 --

commend = Reco("commend")
' 스크립트에 넣을때 계행 처리
commend = Replace(commend, chr(13)&chr(10), "
")
<a href="" title="" onMouseOver="short_msg_show('<%=goodLeft(commend,54)%>')" onMouseOut="short_msg_hide()" >리스트내용</a>


소스 --

<div id="showmsg" style="width:175px; ;z-index:100; visibility: hidden" >
 <table border="0" cellpadding="0" cellspacing="0" width="100%">
  <span id='sp_commend'><tr><td>짧은 글 2줄 표시</td></tr></span>
 </table>
</div>

댓글목록

등록된 댓글이 없습니다.


사이트소개 개인정보취급방침 서비스이용약관 Copyright © kkujunhee.net All rights reserved.
상단으로

개인정보관리책임자 : 관리자

모바일 버전으로 보기