이미지 팝업에 파일명 넣기 정보
이미지 팝업에 파일명 넣기본문
썸네일 이미지를 클릭하면 원본이 팝업창으로 뜨는 소스입니다.
팝업창에 파일명을 표시하고 싶은데 어떻게 해야 할까요.
title에 <?=$filename?>를 넣어도 소용이 없네요.
스크립트 보다 아래에서 파일명이 추출되니 당연하겠지만....
링크 부분에 <?=$filename?>를 넣으면 가능할 것 같은데
방법이 있을까요.
<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>
팝업창에 파일명을 표시하고 싶은데 어떻게 해야 할까요.
title에 <?=$filename?>를 넣어도 소용이 없네요.
스크립트 보다 아래에서 파일명이 추출되니 당연하겠지만....
링크 부분에 <?=$filename?>를 넣으면 가능할 것 같은데
방법이 있을까요.
<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>
댓글 전체
파일명을 팝업이미지 아래에 넣는건가요?
win.document.write ("<img src='"+img+"' border=0 onclick='window.close();' style='cursor:hand' title='클릭하면 닫혀요' id='pop_img'>");
위문장 아래에
win.document.write ("<?=$filename?>"); 이렇게 넣으면 나올것 같은데요.
win.document.write ("<img src='"+img+"' border=0 onclick='window.close();' style='cursor:hand' title='클릭하면 닫혀요' id='pop_img'>");
위문장 아래에
win.document.write ("<?=$filename?>"); 이렇게 넣으면 나올것 같은데요.