탭 최근게시물을 2개 사용할때 오류?.... 정보
탭 최근게시물을 2개 사용할때 오류?....본문
wanee 님의 탭최근게시물을 한페이지에 2개를 사용하려했는데요.( http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=84631&sca=%C3%D6%BD%C5%B1%DB&page=4 )
첫번째건 잘 작동하는데...
두번째로 불러오는건 작동을 안하네요. 마우스를 가져다 놓으면 첫번째 게시물들이 동작을 합니다.
검색을 해봐도 잘모르겠네요. 스크립트부분을 수정하면 될거도 같은데 ... ㅜㅜ
소스는 아래와 같습니다. (어떻게해야할까요... 조언이나 수정부탁드려봅니다.)
---------------------------------------------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");
$tab_img = "{$g4[path]}/tab_img"; //이미지 경로
$tab_width = "265"; //탭메뉴 폭
$tab_gr = "커뮤니티"; //그룹명
$tab_bo1 = "test3"; //처음 출력될 게시판 ID
$tab_bo2 = "test4"; //공지 게시판 ID
?>
<head>
<script language="javascript">
function tab_img_change(t){
for(var i = 1; i <= 2; i++) {
img = document.getElementById('tab_bar'+i);
img.src = "<?=$tab_img?>/tab"+i+"_off.gif";
eval("document.getElementById('tab_view"+i+"')").style.display="none";
if ( t == i ) {
img.src = "<?=$tab_img?>/tab"+i+"_on.gif";
eval("document.getElementById('tab_view"+i+"')").style.display="";
}
}
}
</script>
</head>
<style>
.la { font-family:굴림; font-size:9pt; color:#666666;}
A:link {color:#666666; text-decoration:none; font-size:9pt;}
A:visited {color:#666666; text-decoration:none; font-size:9pt;}
A:active {color:#666666; text-decoration:none; font-size:9pt;}
A:hover {color:#666666; text-decoration:none; font-size:9pt;}
</style>
<table width='<?=$tab_width?>' cellpadding=0 cellspacing=0 border=0>
<tr>
<td width=70 background='<?=$tab_img?>/tabbar_bg.gif'>
<a href="<?=$g4['bbs_path']?>/board.php?bo_table=<?=$tab_bo1?>">
<img id="tab_bar1" style="cursor:pointer;" onMouseOver="tab_img_change(1)" src="<?=$tab_img?>/tab1_on.gif" width="70" height="22" border="0">
</a>
</td>
<td width=71 background='<?=$tab_img?>/tabbar_bg.gif'>
<a href="<?=$g4['bbs_path']?>/board.php?bo_table=<?=$tab_bo2?>">
<img id="tab_bar2" style="cursor:pointer;" onMouseOver="tab_img_change(2)" src="<?=$tab_img?>/tab2_off.gif" width="71" height="22" border="0">
</a>
</td>
<td align="right" width='<?=$tab_width-141?>' background='<?=$tab_img?>/tabbar_bg.gif' style='padding-top:3px;' class='la'><b><?//=$tab_gr?></b><img src='<?=$tab_img?>/more.gif'></td>
</tr>
<tr>
<td colspan='3'>
<div id="tab_view1">
<?=latest('bara_latest',$tab_bo1, 3, 38); //제목길이는 최신글 스킨에서 수정요 ?>
</div>
<div id="tab_view2" style="display: none">
<?=latest('bara_latest',$tab_bo2, 3, 38);?>
</div>
</td>
</tr>
</table>
첫번째건 잘 작동하는데...
두번째로 불러오는건 작동을 안하네요. 마우스를 가져다 놓으면 첫번째 게시물들이 동작을 합니다.
검색을 해봐도 잘모르겠네요. 스크립트부분을 수정하면 될거도 같은데 ... ㅜㅜ
소스는 아래와 같습니다. (어떻게해야할까요... 조언이나 수정부탁드려봅니다.)
---------------------------------------------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");
$tab_img = "{$g4[path]}/tab_img"; //이미지 경로
$tab_width = "265"; //탭메뉴 폭
$tab_gr = "커뮤니티"; //그룹명
$tab_bo1 = "test3"; //처음 출력될 게시판 ID
$tab_bo2 = "test4"; //공지 게시판 ID
?>
<head>
<script language="javascript">
function tab_img_change(t){
for(var i = 1; i <= 2; i++) {
img = document.getElementById('tab_bar'+i);
img.src = "<?=$tab_img?>/tab"+i+"_off.gif";
eval("document.getElementById('tab_view"+i+"')").style.display="none";
if ( t == i ) {
img.src = "<?=$tab_img?>/tab"+i+"_on.gif";
eval("document.getElementById('tab_view"+i+"')").style.display="";
}
}
}
</script>
</head>
<style>
.la { font-family:굴림; font-size:9pt; color:#666666;}
A:link {color:#666666; text-decoration:none; font-size:9pt;}
A:visited {color:#666666; text-decoration:none; font-size:9pt;}
A:active {color:#666666; text-decoration:none; font-size:9pt;}
A:hover {color:#666666; text-decoration:none; font-size:9pt;}
</style>
<table width='<?=$tab_width?>' cellpadding=0 cellspacing=0 border=0>
<tr>
<td width=70 background='<?=$tab_img?>/tabbar_bg.gif'>
<a href="<?=$g4['bbs_path']?>/board.php?bo_table=<?=$tab_bo1?>">
<img id="tab_bar1" style="cursor:pointer;" onMouseOver="tab_img_change(1)" src="<?=$tab_img?>/tab1_on.gif" width="70" height="22" border="0">
</a>
</td>
<td width=71 background='<?=$tab_img?>/tabbar_bg.gif'>
<a href="<?=$g4['bbs_path']?>/board.php?bo_table=<?=$tab_bo2?>">
<img id="tab_bar2" style="cursor:pointer;" onMouseOver="tab_img_change(2)" src="<?=$tab_img?>/tab2_off.gif" width="71" height="22" border="0">
</a>
</td>
<td align="right" width='<?=$tab_width-141?>' background='<?=$tab_img?>/tabbar_bg.gif' style='padding-top:3px;' class='la'><b><?//=$tab_gr?></b><img src='<?=$tab_img?>/more.gif'></td>
</tr>
<tr>
<td colspan='3'>
<div id="tab_view1">
<?=latest('bara_latest',$tab_bo1, 3, 38); //제목길이는 최신글 스킨에서 수정요 ?>
</div>
<div id="tab_view2" style="display: none">
<?=latest('bara_latest',$tab_bo2, 3, 38);?>
</div>
</td>
</tr>
</table>
댓글 전체
자바스크립트를 따로 주시는게 제일 났지 않을까요?.
최근게시물 스킨에 bara_latest / bara_latest2 로 분류한뒤
자바스크립트 역시 따로 주시던지, 혹은 최근게시물 스킨만 일단 분리를 시켜두고 해보시기 바랍니다.
최근게시물 스킨에 bara_latest / bara_latest2 로 분류한뒤
자바스크립트 역시 따로 주시던지, 혹은 최근게시물 스킨만 일단 분리를 시켜두고 해보시기 바랍니다.
l2zeo님 답변 감사합니다.
^^
다른 탭게시물로 해결했습니다.
^^
다른 탭게시물로 해결했습니다.