목진철님께 부탁드립니다. > 그누4 질문답변

그누4 질문답변

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

목진철님께 부탁드립니다. 정보

목진철님께 부탁드립니다.

본문

님께서 수정하여 올리신 elpis_tab 무한 메뉴를 한페이지에서 두개를 동시에 사용할 수 있는 방법이 없으신가하고요.
두개를 동시에 사용하니 처음 것은 정상적으로 가동이되고, 두번째 것은 탭메뉴만 나타나고 리스트는 나오지 않습니다.
지도를 부탁드립니다.
감사합니다. 
  • 복사

댓글 전체

스크립트와 레이어id 값이 중복으로 나오기 때문입니다.

동일한 페이지에서 두개를 사용하기 위해서는 둘중 하나는

스크립트에서 tab_view 와 tap()

레이어의 tab_view 의 아이디값을 변경 해야 합니다.
제가 초보라서 이해가 충분치 않습니다.

tab/basic/tab_list.php 를 2개만들면 되나요?
그리고 아래의 tab_list.php 의 내용중 어디를 어떻게 수정해야 되는지요?

좀 더 자세하게 지도하여 주시기 부탁드립니다.
미안합니다.
------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>

<!-- 탭글자색 -->
<style>
.on {background-image:url('<?=$tab_img?>/on.gif');cursor:pointer; color:#868686}
.off {background-image:url('<?=$tab_img?>/off.gif');cursor:pointer; color:#868686}
</style>
<script language="javascript">
function tap(td,v){
for(var i = 0; i <= <?=count($s_titles)-1?> ; i++) {
img = document.getElementById('tap'+i);
img.className = "off";
eval("document.getElementById('tab_view"+i+"')").style.display="none";
}
td.className = "on"
eval("document.getElementById('tab_view"+v+"')").style.display="";
}
</script>

<table width='<?=$width?>' cellpadding=0 cellspacing=0 border=0>
<tr>
<td width=40 height=29 background='<?=$tab_img?>/bg.gif'><img id="tab_bar1" src="<?=$tab_img?>/icon.gif" width="40" height="29" border="0" /></td>
<!-- <td width='<?=$width-195?>' background='<?=$tab_img?>/bg.gif' style='padding-top:3px;' class='la'><b><?=$title?></b></td> -->

<? for ($i=0 ; $i <= count($s_titles)-1 ;$i++) { ?>
<td width=68 background='<?=$tab_img?>/bg.gif'>
<table cellpadding=0 cellspacing=0 width=68>
<tr><td id="tap<?=$i?>" class="off" width="68" height="29" align=center  onmouseover="tap(this,<?=$i?>)" >
<div style=margin-top:7;></div>
<A href='<?=$g4[path]?>/bbs/board.php?bo_table=<?=$s_boarders[$i]?>' title='목록으로' ><?=$s_titles[$i]?></A>
</td></tr>
</table>
</td>

<? }  ?>
<td width='<?=$width-195?>' background='<?=$tab_img?>/bg.gif' style='padding-top:3px;' class='la' align='right'>
<font color="#868686"><B><?=$title?></B></font>
</td>
<td width=20 background='<?=$tab_img?>/bg.gif'><img src='<?=$tab_img?>/right.gif' width=20 height=29 border=0></td>
</tr>
</table>
<table width='<?=$width?>'>
<tr height=<?=$height?>>
<td valign=top>
<div style=margin-top:5></div>
<? for ($i=0 ; $i <= count($s_titles)-1 ;$i++) { // 아래부분을 반복문으로 했지만 각 게시판마다 다른 최근스킨을 부르면 수동으로 나열하면 됨?>
<div id="tab_view<?=$i?>" style=display:none;>
    <?=latest('denton',$s_boarders[$i], $list, $len); ?>
</div>
<? } ?>
  </td>
</tr>
</table>

<script>
document.getElementById('tap<?=$first-1?>').className = "on"
eval("document.getElementById('tab_view<?=$first-1?>')").style.display="";
</script>
스킨 자체를 완전히 분리 시키세요.
탭스킨1 , 탭스킨2 처럼 분리 시키고 둘중 하나는
의의 소스에서 스크립트와 레이어의 id명을 바꾸고

출력할때도 스킨명을 분리해야 겠죠. 아래처럼

<?=tab_list("basic","탭공지테스트중!!","공지사항/FAQ/QA/게시판", "bbs06_01/bbs06_02/bbs06_03/bbs05_01","1","460*110",5,40);?>

<?=tab_list("basic2","탭공지테스트중!!2","공지사항2/FAQ2/QA2/게시판2", "bbs06_012/bbs06_022/bbs06_032/bbs05_012","1","460*110",5,40);?>
즉시 답하여 주셔서 감사합니다.

tab/basic 스킨을 그대로 복사하여,
tab/basic2 로 올리두고, index.php에서 아래와 같이 정의하였지만 2번째는 역시 탭메뉴만 나타납니다.
아참 제가 초보라서요,
위 말씀 중에 [스크립트와 레이어의 id] 는 무엇을 말하시는지를 모르겠습니다.
예를 하나 들어주시면 고맙겠습니다.
빨리 알아 듣지 못하여 미안합니다.
수정된 예제 입니다.

http://kkk.myhome.tv/gnu/


<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>

<!-- 탭글자색 -->
<style>
.on {background-image:url('<?=$tab_img?>/on.gif');cursor:pointer; color:#868686}
.off {background-image:url('<?=$tab_img?>/off.gif');cursor:pointer; color:#868686}
</style>
<script language="javascript">
function tapm(td,v){
for(var i = 0; i <= <?=count($s_titles)-1?> ; i++) {
img = document.getElementById('tapm'+i);
img.className = "off";
eval("document.getElementById('tab_viewm"+i+"')").style.display="none";
}
td.className = "on"
eval("document.getElementById('tab_viewm"+v+"')").style.display="";
}
</script>

<table width='<?=$width?>' cellpadding=0 cellspacing=0 border=0>
<tr>
<td width=40 height=29 background='<?=$tab_img?>/bg.gif'><img id="tab_bar1" src="<?=$tab_img?>/icon.gif" width="40" height="29" border="0" /></td>
<!-- <td width='<?=$width-195?>' background='<?=$tab_img?>/bg.gif' style='padding-top:3px;' class='la'><b><?=$title?></b></td> -->

<? for ($i=0 ; $i <= count($s_titles)-1 ;$i++) { ?>
<td width=68 background='<?=$tab_img?>/bg.gif'>
<table cellpadding=0 cellspacing=0 width=68>
<tr><td id="tapm<?=$i?>" class="off" width="68" height="29" align=center  onmouseover="tapm(this,<?=$i?>)" >
<div style=margin-top:7;></div>
<A href='<?=$g4[path]?>/bbs/board.php?bo_table=<?=$s_boarders[$i]?>' title='목록으로' ><?=$s_titles[$i]?></A>
</td></tr>
</table>
</td>

<? }  ?>
<td width='<?=$width-195?>' background='<?=$tab_img?>/bg.gif' style='padding-top:3px;' class='la' align='right'>
<font color="#868686"><B><?=$title?></B></font>
</td>
<td width=20 background='<?=$tab_img?>/bg.gif'><img src='<?=$tab_img?>/right.gif' width=20 height=29 border=0></td>
</tr>
</table>
<table width='<?=$width?>'>
<tr height=<?=$height?>>
<td valign=top>
<div style=margin-top:5></div>
<? for ($i=0 ; $i <= count($s_titles)-1 ;$i++) { // 아래부분을 반복문으로 했지만 각 게시판마다 다른 최근스킨을 부르면 수동으로 나열하면 됨?>
<div id="tab_viewm<?=$i?>" style=display:none;>
    <?=latest('denton',$s_boarders[$i], $list, $len); ?>
</div>
<? } ?>
  </td>
</tr>
</table>

<script>
document.getElementById('tapm<?=$first-1?>').className = "on"
eval("document.getElementById('tab_viewm<?=$first-1?>')").style.display="";
</script>
© SIRSOFT
현재 페이지 제일 처음으로