사이트 내 전체검색
이미지 팝업
로빈아빠
https://cmd.kr/javascript/725 URL이 복사되었습니다.

본문

이미지 팝업

959f8e4d_122689566108882
드레그가능 더블클릭으로 닫기.

<html>
<head>
<META http-equiv=Content-Type content=text/html;charset=euc-kr>
<meta http-equiv="imagetoolbar" content="no">
<title> 마우스로 이미지를 끌어 확인하세요 </title>
<style>
.drag { position: relative; cursor:move; }
</style>

<script language="JavaScript">
<!--
var bdown = false;
var x, y;
var sElem;

function mdown(evt) {
evt = (evt) ? evt : ((window.event) ? window.event : "");
sElem = evt.target ? evt.target : evt.srcElement;

if (evt.stopPropagation) {	
	evt.stopPropagation();
	evt.preventDefault();
}
evt.returnValue  = false;
evt.cancelBubble = true;

if(sElem.className == "drag") {
  bdown = true;
  x = evt.clientX;
  y = evt.clientY;
}
}
function mup() {
bdown = false;
}

document.onmousemove = function moveimg(event) {
event = (event) ? event : ((window.event) ? window.event : "");
if(bdown) {
  var distX = event.clientX - x;
  var distY = event.clientY - y;
  var targetImg = document.getElementById('imgTomove');
  targetImg.style.left = (parseInt(targetImg.style.left) + distX) + 'px';
  targetImg.style.top = (parseInt(targetImg.style.top) + distY) + 'px';
  x = event.clientX;
  y = event.clientY;
return false;
}
}


function setSize (x,y) {
	var windowX, windowY;
		//window.resizeTo(200, 200);

		if (document.all)
		{
			width = 212 - (document.body.clientWidth -  document.images[0].width);
			height = 231 - (document.body.clientHeight -  document.images[0].height);
		} else {
			width = 208 - (document.body.clientWidth -  document.images[0].width);
			height = 249 - (document.body.clientHeight -  document.images[0].height);
		}
		
		windowX = (window.screen.availWidth-width)/2;
		windowY = (window.screen.availHeight-height)/3;
		if(width>screen.availWidth){
			width = screen.availWidth;
			windowX = 0;
		}
		if(height>screen.availHeight){
			height = screen.availHeight;
			windowY = 0;
		}
		window.resizeTo(width, height);
		window.moveTo(windowX,windowY);
}
//-->
</script>

<script type="text/javascript">
function cursor(evt)
{
	evt = (evt) ? evt : ((window.event) ? window.event : "")
	document.getElementById('trail').style.display=""
	document.getElementById('trail').style.position="absolute"
	document.getElementById('trail').style.zIndex="3"
	document.getElementById('trail').style.left=evt.clientX+10
	document.getElementById('trail').style.top=evt.clientY
}
</script>
</head>
<body style="margin:0px; padding:0px; border:0px;" bgcolor="#fbfbfb" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onmousemove="cursor(event)" ondblclick="window.close();" oncontextmenu="return false;" onload="setSize();">

<span id="trail" style="display:none; width:90px; border:1px solid #000000; padding:2px; background-color:#e5ecf9;font-family:돋움;font-size:8pt;color:#EF5900;">드레그 = 이동<br>더블클릭 = 닫기</span>
<table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%">
    <tr>
    <td align=center valign=middle>
		<img id="imgTomove" style="left:0px;top:0px"onmousedown="mdown(event);" onmouseup="mup();" name="cnjimg" ondblclick="window.close();" src="http://yesyo.com/forums/image.php?u=1&dateline=1105894265" class="drag" oncontextmenu="return false;">
    </td>
  </tr>
</table>
</body>
</html>

댓글목록

등록된 댓글이 없습니다.

831 (5/17P)

Search

Copyright © Cmd 명령어 18.227.0.255