본문
/theme/community/mobile/head.php 에서
<nav class="side_menu">
<ul>
<?php
$sql = " select *
from {$g5['menu_table']}
where me_use = '1'
and length(me_code) = '2'
order by me_order, me_id ";
$result = sql_query($sql, false);
for ($i=0; $row=sql_fetch_array($result); $i++) {
?>
<li class="mu_title">
<?php
$submenus = '';
$sql2 = " select *
from {$g5['menu_table']}
where me_use = '1'
and length(me_code) = '4'
and substring(me_code, 1, 2) = '{$row['me_code']}'
order by me_order, me_id ";
$result2 = sql_query($sql2);
for ($k=0; $row2=sql_fetch_array($result2); $k++) {
if($k == 0) {
$submenus .= '<button type="button" class="sub_toggle">하위메뉴</button>'.PHP_EOL;
$submenus .= '<ul class="sub_menu">'.PHP_EOL;
}
$submenus .= '<li><a href="'.$row2['me_link'].'" target="_'.$row2['me_target'].'" class="gnb_2da sub_tit2">'.$row2['me_name'].'</a></li>'.PHP_EOL;
}
if($k > 0)
$submenus .= '</ul>'.PHP_EOL;
if($submenus)
$gnb_class = 'sd_cl';
else
$gnb_class = 'sd_cl';
?>
<a href="<?php echo $row['me_link']; ?>" target="_<?php echo $row['me_target']; ?>" class="<?php echo $gnb_class; ?> sub_tit1"><?php echo $row['me_name'] ?></a>
<?php echo $submenus; ?>
</li>
<?php
}
if ($i == 0) { ?>
<li id="side_menu_empty">메뉴 준비 중입니다.<?php if ($is_admin) { ?> <br><a href="<?php echo G5_ADMIN_URL; ?>/menu_list.php">관리자모드 > 환경설정 > 메뉴설정</a>에서 설정하세요.<?php } ?></li>
<?php } ?>
</ul>
</nav>
// 아래 부분 추가하기
<style>/* 모바일 우측 상단 메뉴시작시 서브메뉴 열려있게 하기 */
.side_menu ul .mu_title ul{display:block}
</style>
댓글목록
등록된 댓글이 없습니다.