javascript | 마우스 오버시 특정 위치에 내용 보여 주기
페이지 정보
작성자 100K5 작성일12-04-01 09:35 조회55,595회 댓글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;
}
<!--
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>
댓글목록
등록된 댓글이 없습니다.