이미지나텍스트 클릭시 새창으로 원본이미지 정보
이미지나텍스트 클릭시 새창으로 원본이미지
본문
로 질문을 하여 해피정님께 답변을 받았는데요.
정말감사합니다 해피정님!~
소스 : http://happyjung.com/gnuboard/bbs/board.php?bo_table=lecture&wr_id=85
그런데,
이미지..새창뜬거에서..
클릭시 창이닫히는데, 마우스포인트가 손가락으로 나오게끔..할순없나요?^^;;
정말감사합니다 해피정님!~
소스 : http://happyjung.com/gnuboard/bbs/board.php?bo_table=lecture&wr_id=85
그런데,
이미지..새창뜬거에서..
클릭시 창이닫히는데, 마우스포인트가 손가락으로 나오게끔..할순없나요?^^;;
댓글 전체
아래 내용을 사용하시면 IE 7에서 효과적으로 보여집니다.
<script type="text/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;
}
imgwin = window.open("", "imageWin","width=" + imgObj.width + ",height=" + imgObj.height);
imgwin.document.write("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>");
imgwin.document.write("<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8' />"); // euc-kr? utf-8?
imgwin.document.write("<title>큰이미지</title>"); // 새창 페이지 제목
imgwin.document.write("</head><body style='margin:0px;padding:0px'>");
imgwin.document.write("<img src='" + imgObj.src + "' style='cursor:pointer; border: 1px solid #DDDDDD;' onclick='self.close();' alt='이미지를 클릭하시면 창이 닫힙니다.' />");
imgwin.document.write("</body><html>");
imgwin.document.title = imgObj.src;
}
//-->
</script>
<a href="javascript:showImgWin('v6/images/index_customer.jpg')">새창으로 이미지 뜨기</a>
<script type="text/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;
}
imgwin = window.open("", "imageWin","width=" + imgObj.width + ",height=" + imgObj.height);
imgwin.document.write("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>");
imgwin.document.write("<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8' />"); // euc-kr? utf-8?
imgwin.document.write("<title>큰이미지</title>"); // 새창 페이지 제목
imgwin.document.write("</head><body style='margin:0px;padding:0px'>");
imgwin.document.write("<img src='" + imgObj.src + "' style='cursor:pointer; border: 1px solid #DDDDDD;' onclick='self.close();' alt='이미지를 클릭하시면 창이 닫힙니다.' />");
imgwin.document.write("</body><html>");
imgwin.document.title = imgObj.src;
}
//-->
</script>
<a href="javascript:showImgWin('v6/images/index_customer.jpg')">새창으로 이미지 뜨기</a>