파이어폭스에 해당되는 글 1건"
2006/12/12 레이어 팝업(움직임 가능, 파이어폭스 가능) (1)

레이어 팝업(움직임 가능, 파이어폭스 가능)

Chance is/Develop | 2006/12/12 14:41

<script language="JavaScript">
<!--

isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;

function ddInit(e){
topDog=isIE ? "BODY" : "HTML";
whichDog=isIE ? document.all.popWindow : document.getElementById("popWindow");
hotDog=isIE ? event.srcElement : e.target;
while (hotDog.id!="popWindow"&&hotDog.tagName!=topDog){
 hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
}
if (hotDog.id=="popWindow"){
 offsetx=isIE ? event.clientX : e.clientX;
 offsety=isIE ? event.clientY : e.clientY;
 nowX=parseInt(whichDog.style.left);
 nowY=parseInt(whichDog.style.top);
 ddEnabled=true;
 document.onmousemove=dd;
}
}

function dd(e){
if (!ddEnabled) return;
whichDog.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx;
whichDog.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
return false;
}

document.onmousedown=ddInit;
document.onmouseup=Function("ddEnabled=false");

//-->
</script>

IE와 FireFox 둘다 정상작동함(FireFox는 약간 부드럽지 않음)

<div id="popWindow" style="position:absolute; left:305px; top:110px; z-index:100; visibility;" onSelectStart="return false">
<table border="1" bgcolor="#ffffff" width="300" height="400" cellspacing="0" cellpadding="0">
<tr>
 <td align="center" valign="middle">
  <a href="http://www.chanceis.com" target="_blank"><img src="http://www.chanceis.com/attach/1/1330481279.jpg" border="0"></a>
 </td>
</tr>
</table>
</div>



2006/12/12 14:41 2006/12/12 14:41
◀ 이전 : [1] : 다음 ▶