게시판 뷰페이지 이미지 뛰우기 정보
게시판 뷰페이지 이미지 뛰우기본문
이 게시판을 쓰고 있는데요...
이 게시판 뷰페이지에서 큰이미지보기를 클릭하면 이미지가 뜨고 큰이미지보기 위에 있는 이미지는 클릭이 안되는데요..
지금 할려는건 이미지를 클릭했을때도 큰이미지보기처럼 이미지를 뛰울려고 합니다
이것저것 만저봤는데 영 안돼네요...
일단 뷰페이지에서 제가
if (file_exists($thumb) && $filename) {
$img = "<img src='$thumb''$filename'>";
echo "<tr><td align=center><a href='javascript:void(0);' onClick='View_Open();'>$img</td></tr>";
$img = "<img src='$thumb''$filename'>";
echo "<tr><td align=center><a href='javascript:void(0);' onClick='View_Open();'>$img</td></tr>";
이런식으로 하니까 팝업창까지는 뜨는데요 이미지가 안뜨네요...
onClick='View_Open() 이안에 변수를 집어 넣으면 스크립트 에러가 나구요..
해결방법이 없을까요??
댓글 전체
image_window(img)
common.js 파일의 189 라인부터 279라인까지 참고하세요...^^
common.js 파일의 189 라인부터 279라인까지 참고하세요...^^
그런데 뷰페이지에
<!--
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>원본 이미지 보기</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();
}
//-->
이렇게 되어있습니다.
큰이미지보기 소스를 보면
<a href="javascript:void(0);" onClick="View_Open('<?=$data_path?>/<?=$filename?>');"><img src='<?=$board_skin_path?>/img/icon_open.gif' alt='큰이미지 보기'border=0></a>
이렇게 되어있는데 View_Open()안에 있는 변수를 집어넣으니까 스크립트 에러가 나고 ㅡㅡ
어떻게 해야할지??
<!--
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>원본 이미지 보기</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();
}
//-->
이렇게 되어있습니다.
큰이미지보기 소스를 보면
<a href="javascript:void(0);" onClick="View_Open('<?=$data_path?>/<?=$filename?>');"><img src='<?=$board_skin_path?>/img/icon_open.gif' alt='큰이미지 보기'border=0></a>
이렇게 되어있는데 View_Open()안에 있는 변수를 집어넣으니까 스크립트 에러가 나고 ㅡㅡ
어떻게 해야할지??
제가 해결했습니다....간단한걸 이렇게 해매다니 ㅡㅡ