출처 : 야후 뉴스
<script language=javascript>
function move_win() {
var name = navigator.appName;
var img_width = document.view_img.width;
var img_height = document.view_img.height;
var chk_width = screen.availWidth;
if(chk_width <= img_width) {
width = chk_width;
}
else {
if(name == 'Microsoft Internet Explorer') {
width = img_width + 12;
} else {
width = img_width + 8;
}
}
var chk_height = screen.availHeight;
if(chk_height <= img_height) {
height = chk_height;
}
else {
if(name == 'Microsoft Internet Explorer') {
height = img_height + 30 + 20;
} else {
height = img_height + 45;
}
}
self.resizeTo(width, height);
if(document.all) { // for ie4+
var moveY = (window.screen.height - document.body.clientHeight)/2 - 30;
var moveX = (window.screen.width - document.body.clientWidth)/2 - 6;
moveTo(moveX, moveY);
}
else if (document.layers || document.getElementById) {
moveTo(screen.availLeft, screen.availTop);
}
self.focus();
}
function img_move() {
if((document.view_img.width > (screen.availWidth - 9)) || (document.view_img.height > (screen.availHeight - 24))) {
var x_scale = document.view_img.width/screen.availWidth;
var y_scale = document.view_img.height/screen.availHeight;
window.scroll(x_scale*(window.event.clientX - 50), y_scale*(window.event.clientY - 50));
}
}
</script>
<style type="text/css">
html, body {
margin: 0;
padding: 0;
position: absolute;
top: 0;
left: 0;
}
img {
border: 0;
display: block;
}
</style>
</head>
<body bgcolor="#D4D0C8" onLoad="move_win();"><img src="http://img.news.yahoo.co.kr/picture/e5/20060917/e520060917_27091987.jpg" name=view_img border=0 style="cursor:crosshair;margin:0" onMousemove="img_move();" onClick="javascript:window.close();" ></body>
샘플;;

img.html
이올린에 북마크하기