IE9 이미지 새창 사이즈

· 14년 전 · 1996 · 3
첨부파일 이미지를 썸네일 형식으로 본문에 모두 보이게 하고
그 썸네일을 클릭하면 원본이 뜨는 팁을 사용중입니다.
아래와 같은 스크립트 입니다.

IE8과 크롬에서 테스트하니 이상이 없는데
IE9에서는 새 창 크기가 아주 작게 떠서
마우스로 키워야 볼 수 있네요.
IE9에서도 원본 크기로 새 창을 띄우고 싶어요.^^

<scRIPT LANGUAGE='Javascript'>
<!--
// 이미지뷰어
var win= null;
function View_Open(img, w, h) {
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/3;
var settings ='height='+h+',';
settings +='width='+w+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars=yes,';
settings +='resizable=yes,';
settings +='status=no';

win=window.open("","newWindow",settings);
win.document.open();
win.document.write ("<html><head><title><?=$filename?></title></head>");
win.document.write ("<script>function init(){window.resizeBy(document.all.pop_img.width-document.body.clientWidth, document.all.pop_img.height-document.body.clientHeight+10);}</script>");
win.document.write ("<body bgcolor=white topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 onload='init();'>");
win.document.write ("<img src='"+img+"' border=0 onclick='window.close();' style='cursor:hand' title='클릭하면 닫혀요' id='pop_img'>");
win.document.write ("</body></html>");
win.document.close();
}

image_directory = ""; //배경이미지 경로
clear = new Image(); clear.src = image_directory + "./img/blank.gif";

//-->
</scRIPT>

<a href="javascript:void(0);" onClick="View_Open('<?=$data_path?>/<?=$filename?>')"><img src='<?=$thumb?>' border=0 width="116" height="116"></a>
|

댓글 3개

소스자체가 제대로 작동안될텐데요......IE와 크롬에서 이상이 없으시다구요?

View_Open 함수에서 넘겨받아야 할 인자가 이미지경로와 표시될 w, h 값이 있어야 하는데

보시면 w, h 값이 빠져 있으면....그런데 제대로 작동할리가 없는데요....
잘 되는데요.^^
스킨자료실에 있는 스킨에서 따온 겁니다.
돌아댕기는 거 주워서 해결했습니다. IE9에서도 제대로 보이네요.
자바스크립트 공부해야 하는데....^^

<SCRIPT LANGUAGE="JavaScript">
<!--
function imgResize(img){
img1= new Image();
img1.src=(img);
imgControll(img);
}
function imgControll(img){
if((img1.width!=0)&&(img1.height!=0)){
viewImage(img);
}
else{
controller="imgControll('"+img+"')";
intervalID=setTimeout(controller,20);
}
}
function viewImage(img){
W=img1.width;
H=img1.height;
O="width="+W+",height="+H;
imgWin=window.open("","",O);
imgWin.document.write("<html><head><title></title></head>");
imgWin.document.write("<body topmargin=0 leftmargin=0>");
imgWin.document.write("<img src="+img+" onclick='self.close()' style=cursor:hand title='클릭하면 닫혀요'>");
imgWin.document.close();
}
// -->
</script>


<a href="javascript:void(0);" onClick="javascript:imgResize('<?=$data_path?>/<?=$filename?>')"><img src='<?=$thumb?>' border=0 width="116" height="116"></a>
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
14년 전 조회 820
14년 전 조회 783
14년 전 조회 1,599
14년 전 조회 3,183
14년 전 조회 717
14년 전 조회 752
14년 전 조회 775
14년 전 조회 1,569
14년 전 조회 853
14년 전 조회 1,997
14년 전 조회 1,014
14년 전 조회 984
14년 전 조회 763
14년 전 조회 2,491
14년 전 조회 2,342
14년 전 조회 2,103
14년 전 조회 715
14년 전 조회 1,581
14년 전 조회 1,079
14년 전 조회 700
🐛 버그신고