아래소스를 <head>와</head>사이에 넣어줍니다.

<script language="JavaScript">
var imgObj = new Image();
function showImgWin(imgName) {
imgObj.src = imgName;
setTimeout("createImgWin(imgObj)", 100);
}
function createImgWin(imgObj) {
if (! imgObj.complete) {
setTimeout("createImgWin(imgObj)", 100);
return;
}
imageWin = window.open("", "imageWin",
"width=" + imgObj.width + ",height=" + imgObj.height);
imageWin.document.write("<html><body style='margin:0'>");
imageWin.document.write("<img src='" + imgObj.src + "'>");
imageWin.document.write("</body><html>");
imageWin.document.title = imgObj.src;
}
</script>

<body>와</body>사이에 넣어줍니다

<a href="javascript:showImgWin('이미지주소')">이미지 보기</a>

+ Recent posts