<html>
<head>
<title>이미지에 클릭후 움직이면 스크롤 됩니다. 이미지에 더블클릭 하면 닫힙니다.</title>
<meta http-equiv=Content-Type content=text/html; charset=EUC-KR>
<META HTTP-EQUIV="imagetoolbar" CONTENT="no">
</head>

<font style="height:0;">
</font>

<script language="JavaScript" src="default.js" type="text/JavaScript"></script>

<script language="javascript">

var windowX, windowY;
var bLargeImage = 0;
var x,y,mx,my;

function fitWindowSize()
{
window.resizeTo(200, 200);
width = 200 - (d0cument.body.clientWidth - d0cument.images[0].width);
height = 200 - (d0cument.body.clientHeight - d0cument.images[0].height);

windowX = (window.screen.width-width)/2;
windowY = (window.screen.height-height)/2;
if(width>screen.width){
width = screen.width;
windowX = 0;
bLargeImage = 1;
}
if(height>screen.height){
height = screen.height;
windowY = 0;
bLargeImage = 1;
}
x = width/2;
y = height/2;
window.resizeTo(width, height);
window.moveTo(windowX,windowY);
}

var posX = 0;
var posY = 0;
var posX2 = 0;
var posY2 = 0;
var captureMode = false;

function MouseCheck(event,obj) {
captureMode = captureMode ? false : true;
posX = event.x;
posY = event.y;
obj.style.cursor = captureMode ? 'move' : 'pointer';
}
function scrollPage(event) {
if(!captureMode) return;
move = 1;
posX2 = event.clientX;
posY2 = event.clientY;
pX = posX - posX2;
pY = posY - posY2;
window.scrollBy(pX,pY);
posX = event.clientX;
posY = event.clientY;
}

function move(event){
if(bLargeImage)window.scroll(event.clientX - wx,event.clientY -wy);
return true;
}
</script>

<body onLoad="fitWindowSize()" style='margin:0'>
<img src="http://www.thinkmania.com/zb40/data/ibmuserlecture/c.jpg" border="0" onDblClick='window.close()' onmousemove="scrollPage(event)" onClick="MouseCheck(event,this)" style="cursor:pointer">
</body>
</html>

Posted by 퓨전마법사
,