마우스를 따라 다니는 레이어
본문
<scRIPT>
function move()
{
if(document.body.offsetWidth < suldo.offsetWidth + event.x + 6 + 16 + 10)
{
suldo.style.left = document.body.scrollLeft + document.body.offsetWidth - suldo.offsetWidth - 6 - 16;
}
else
{
suldo.style.left = document.body.scrollLeft + 10 + event.x;
}
if(document.body.offsetHeight < suldo.offsetHeight + event.y + 6 + 10)
{
suldo.style.top = document.body.scrollTop + document.body.offsetHeight - suldo.offsetHeight - 6;
}
else
{
suldo.style.top = document.body.scrollTop + 10 + event.y;
}
}
window.document.onmousemove = move;
</scRIPT>
function move()
{
if(document.body.offsetWidth < suldo.offsetWidth + event.x + 6 + 16 + 10)
{
suldo.style.left = document.body.scrollLeft + document.body.offsetWidth - suldo.offsetWidth - 6 - 16;
}
else
{
suldo.style.left = document.body.scrollLeft + 10 + event.x;
}
if(document.body.offsetHeight < suldo.offsetHeight + event.y + 6 + 10)
{
suldo.style.top = document.body.scrollTop + document.body.offsetHeight - suldo.offsetHeight - 6;
}
else
{
suldo.style.top = document.body.scrollTop + 10 + event.y;
}
}
window.document.onmousemove = move;
</scRIPT>
<div id="suldo" style="position:absolute; width:200px; height:100;
border: 1px solid #000000; background-color: #2080ff;">
어떠세요..?ㅎㅎㅎ응용하세요...</div>
border: 1px solid #000000; background-color: #2080ff;">
어떠세요..?ㅎㅎㅎ응용하세요...</div>
출처 : http://www.aircon1004.com/data/bbs/board.php?bo_table=pds1&wr_id=153
관련링크
댓글목록
등록된 댓글이 없습니다.