카텝고리 탭에서 전체가 아래로 가있고 탭목록에서 전체가 표시되는 기이한 현상 ㅠ.ㅠ
본문

위의 주소로 가시면 이런 현상이 나타나요. 전체가 원래 제일 상단으로 가있고 새로고침하면 전체가나오고 탭목록을 클릭 하면 그에 해당하는 목록이 나와야 되는데 이건좀 이상하게 나오네여..
원래대로 나오게 고칠 수 없을까요? 흐음 소스를 고치고 수정해봐도,, 초보자에겐 너무 어렵네요.ㅠ.ㅠ
소스를 살펴 보자면.. 요렇습니다.
<!-- 분류 셀렉트 박스, 게시물 몇건, 관리자화면 링크 -->
<div style="float:left;height:22px;">
<? if ($is_category) { ?>
<? if (!$wr_id) { ?>
<?
$cnt = 1;
$arr = explode("|", $board[bo_category_list]); // 구분자가 , 로 되어 있음
$str = " <span style='font-family: Tahoma; font-size:10px; color:#D2D2D2;'>|</span> ";
$str .= "<select onchange=\"location.href='./board.php?bo_table=$bo_table&sca='+this.options[this.selectedIndex].value\">";
for ($i=0; $i<count($arr); $i++)
if (trim($arr[$i])) {
$selected = "";
if ($sca == $arr[$i]) { $selected ="selected";}
$str .= "<option value='".urlencode($arr[$i])."' $selected>". $arr[$i] ."</option>";
$cnt++;
}
$str .= "<option value=''>전체</option></select>";
<? if ($is_category) { ?>
<? if (!$wr_id) { ?>
<?
$cnt = 1;
$arr = explode("|", $board[bo_category_list]); // 구분자가 , 로 되어 있음
$str = " <span style='font-family: Tahoma; font-size:10px; color:#D2D2D2;'>|</span> ";
$str .= "<select onchange=\"location.href='./board.php?bo_table=$bo_table&sca='+this.options[this.selectedIndex].value\">";
for ($i=0; $i<count($arr); $i++)
if (trim($arr[$i])) {
$selected = "";
if ($sca == $arr[$i]) { $selected ="selected";}
$str .= "<option value='".urlencode($arr[$i])."' $selected>". $arr[$i] ."</option>";
$cnt++;
}
$str .= "<option value=''>전체</option></select>";
?>
<?=$str?>
<? } ?>
<? } ?>
</div>
<?=$str?>
<? } ?>
<? } ?>
</div>
답변 2
$str .= "<select onchange=\"location.href='./board.php?bo_table=$bo_table&sca='+this.options[this.selectedIndex].value\">";
$str .= "<option value=''>전체</option>";
for ($i=0; $i<count($arr); $i++)
if (trim($arr[$i])) {
$selected = "";
if ($sca == $arr[$i]) { $selected ="selected";}
$str .= "<option value='".urlencode($arr[$i])."' $selected>". $arr[$i] ."</option>";
$cnt++;
}
$str.="<select>";
?>
<?=$str?>
<?=$str?>
전체 <option value=''>전체</option>부분을 for문 앞으로 올려 주시면 될겁니다.
많은 도움이 되었습니다. 감사합니다.
답변을 작성하시기 전에 로그인 해주세요.