최신글 제목클릭시 팝업창을 항상위로 띄우기.. 왕꼼수+왕허접 > 그누3 팁자료실

그누3 팁자료실

최신글 제목클릭시 팝업창을 항상위로 띄우기.. 왕꼼수+왕허접 정보

기타 최신글 제목클릭시 팝업창을 항상위로 띄우기.. 왕꼼수+왕허접

첨부파일

pop_up.rar (1.4K) 42회 다운로드 2004-02-18 22:21:52

본문

아주 오래전부터 개인적으로 애용하는 허접한 팁입니다.
최신글 스킨의 링크타겟만 설정해주면 되므로 버전에 관계없이 적용가능...^)^..
첨부파일은 3.02버전의 latest/basic에서 latest.skin.php 파일의 링크타겟만 지정한 것 입니다.

//javascript.js 에 맨 아랫부분에 첨가합니다
//최신글 클릭시 항상위로 올라오면서 글내용이 로드되게 하기
var gnu = null;
function fork( type ) {
if(type == "board" ) gnu = window.open('', 'gnu', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=660,height=500,top=0,left=0');
else if(type == "gallery" ) gnu = window.open('', 'gnua', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=900,height=600,left=0,top=0');
/*다양한 창크기와 위치, 각종설정을 원하는 대로 지정해서 확장해줍니다.
예)
else if(type == "link" ) gnu = window.open('', 'gnub', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=1000,height=600,left=0,top=30');
*/
else alert("Fatal : in function fork()");
gnu.focus();
return;
}

//끝


그리고 최신글 스킨에서 latest.skin.php 파일의 링크부분에 타겟을 설정합니다.

예)
target='gnu' onClick="fork('board')"
target='gnua' onClick="fork('gallery')"

특징)
처음 링크를 클릭할때는 지정한 위치에 지정된 옵션으로 팝업창이 뜹니다.
최소화 또는 뒷쪽으로 묻혀있는 상태에서 링크를 클릭하면 묻여있던 팝업창이 전면으로 올라오면서 내용이 로드됩니다.
같은 이름의 타겟을 중복 사용할경우 하나의 팝업창으로 내용만 로드되므로 팝업창이 여러개 생기지않습니다.
javascript.js에 선언되었기 때문에 헤더가 붙어있는 모든 파일에서 타겟 적용이 가능합니다.

저는 카운터등 일반적인 팝업창을 띄울때도 사용한답니다.

첨부한 스킨을 사용해서 최신글을 링크할때..
<?=latest('pop_up',보드 테이블 이름, 5, 30);?>


latest.skin.php 파일에 적용할때..

<table width=100% cellpadding=0 cellspacing=1>
<tr><td colspan=3 height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
<tr class='subject subjectbg ht'><td colspan=3 align=center><a href='<?="./?doc=$cfg[bbs_dir]/gnuboard.php&bo_table=$bo_table"?>'><?=$bo_subject?></a></td></tr>
<tr><td colspan=3 height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>

<? for ($i=0; $i<count($list); $i++) { ?>
<tr height=22>
 &nbsp; &nbsp;<td width=60><?=$list[$i][date]?></td>
 &nbsp; &nbsp;<td><?=$list[$i][icon_new]?><a href='<?="./?doc=$cfg[bbs_dir]/gnuboard.php&bo_table=$bo_table&wr_id={$list[$i][wr_id]}"?>' target='gnu' onClick="fork('board')"><?=$list[$i][subject]?></a> <?=$list[$i][commentcnt]?></td>
 &nbsp; &nbsp;<td width=70 align=center><?=$list[$i][name]?></td>
</tr>
<? } ?>

<? if (count($list) == 0) { echo "<tr><td colspan=3 align=center height=50>자료가 없습니다.</td></tr>"; } ?>
</table>
추천
2

댓글 전체

전체 1,026
그누3 팁자료실 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT