관리자: gnb 아이디 클래스명 수정

This commit is contained in:
whitedot
2013-04-29 15:06:00 +09:00
parent ead1b117de
commit 3924235e61
4 changed files with 82 additions and 46 deletions

View File

@ -18,7 +18,7 @@ function print_menu2($key, $no)
{
global $menu, $auth_menu, $is_admin, $auth, $g4;
$str .= "<ul class=\"gnb_sub_ul\">";
$str .= "<ul class=\"gnb_2dul\">";
for($i=1; $i<count($menu[$key]); $i++)
{
if ($is_admin != 'super' && (!array_key_exists($menu[$key][$i][0],$auth) || !strstr($auth[$menu[$key][$i][0]], 'r')))
@ -31,7 +31,7 @@ function print_menu2($key, $no)
if ($menu[$key][$i][4] == 1) $gnb_grp_style = 'gnb_grp_style';
else $gnb_grp_style = '';
$str .= '<li class="gnb_2depth"><a href="'.$menu[$key][$i][2].'" class="'.$gnb_grp_style.' '.$gnb_grp_div.'">'.$menu[$key][$i][1].'</a></li>';
$str .= '<li class="gnb_2dli"><a href="'.$menu[$key][$i][2].'" class="gnb_2da '.$gnb_grp_style.' '.$gnb_grp_div.'">'.$menu[$key][$i][1].'</a></li>';
$auth_menu[$menu[$key][$i][0]] = $menu[$key][$i][1];
}
@ -99,19 +99,19 @@ function imageview(id, w, h)
<h2>관리자 주메뉴</h2>
<script>$('#gnb').addClass('gnb_js');</script>
<?php
$gnb_str = "<ul id=\"gnb_ul\">";
$gnb_str = "<ul id=\"gnb_1dul\">";
foreach($amenu as $key=>$value) {
$href1 = $href2 = '';
if ($menu['menu'.$key][0][2]) {
$href1 = '<a href="'.$menu['menu'.$key][0][2].'">';
$href1 = '<a href="'.$menu['menu'.$key][0][2].'" class="gnb_1da">';
$href2 = '</a>';
} else {
continue;
}
$current_class = "";
if (isset($sub_menu) && (substr($sub_menu, 0, 2) == substr($menu['menu'.$key][0][0], 0, 2)))
$current_class = " gnb_1depth_air";
$gnb_str .= "<li class=\"gnb_1depth".$current_class."\">";
$current_class = " gnb_1dli_air";
$gnb_str .= '<li class="gnb_1dli'.$current_class.'">'.PHP_EOL;
$gnb_str .= $href1 . $menu['menu'.$key][0][1] . $href2;
$gnb_str .= print_menu1('menu'.$key, 1);
$gnb_str .= "</li>";

View File

@ -40,11 +40,12 @@ $(function(){
});
// 주메뉴
var $gnb = $('.gnb_1depth > a');
var $gnb = $(".gnb_1dli > a");
$gnb.mouseover(function() {
if(mouse_event) {
$('.gnb_1depth').removeClass('gnb_1depth_over gnb_1depth_on');
$(this).parent().addClass('gnb_1depth_over gnb_1depth_on');
$(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on");
$(this).parent().addClass("gnb_1dli_over gnb_1dli_on");
menu_rearrange($(this).parent());
hide_menu = false;
}
});
@ -53,17 +54,18 @@ $(function(){
hide_menu = true;
});
$('.gnb_1depth li').mouseover(function() {
$(".gnb_2dli").mouseover(function() {
hide_menu = false;
});
$('.gnb_1depth li').mouseout(function() {
$(".gnb_2dli").mouseout(function() {
hide_menu = true;
});
$gnb.focusin(function() {
$('.gnb_1depth').removeClass('gnb_1depth_over gnb_1depth_on');
$(this).parent().addClass('gnb_1depth_over gnb_1depth_on');
$(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on");
$(this).parent().addClass("gnb_1dli_over gnb_1dli_on");
menu_rearrange($(this).parent());
hide_menu = false;
});
@ -71,29 +73,63 @@ $(function(){
hide_menu = true;
});
$('.gnb_1depth ul a').focusin(function() {
$('.gnb_1depth').removeClass('gnb_1depth_over gnb_1depth_on');
var $gnb_li = $(this).closest('.gnb_1depth').addClass('gnb_1depth_over gnb_1depth_on');
$(".gnb_2da").focusin(function() {
$(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on");
var $gnb_li = $(this).closest(".gnb_1dli").addClass("gnb_1dli_over gnb_1dli_on");
menu_rearrange($(this).closest(".gnb_1dli"));
hide_menu = false;
});
$('.gnb_1depth ul a').focusout(function() {
$(".gnb_2da").focusout(function() {
hide_menu = true;
});
$(document).click(function() {
$('#gnb_1dul>li').bind('mouseleave',function(){
submenu_hide();
});
$(document).bind('click focusin',function(){
if(hide_menu) {
$('.gnb_1depth').removeClass('gnb_1depth_over gnb_1depth_on');
submenu_hide();
}
});
$(document).focusin(function() {
if(hide_menu) {
$('.gnb_1depth').removeClass('gnb_1depth_over gnb_1depth_on');
}
});
function submenu_hide() {
$(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on");
}
// 텍스트 리사이즈 카운트 쿠키있으면 실행
var resize_act;
var text_resize_count = parseInt(get_cookie("ck_font_resize_count"));
if(!isNaN(text_resize_count)) {
if(text_resize_count > 0)
resize_act = "increase";
else if(text_resize_count < 0)
resize_act = "decrease";
if(Math.abs(text_resize_count) > 0)
font_resize2("container", resize_act, Math.abs(text_resize_count));
}
});
function menu_rearrange(el)
{
var width = $("#gnb_1dul").width();
var left = w1 = w2 = 0;
var idx = $(".gnb_1dli").index(el);
for(i=0; i<=idx; i++) {
w1 = $(".gnb_1dli:eq("+i+")").outerWidth();
w2 = $(".gnb_2dli > a:eq("+i+")").outerWidth(true);
if((left + w2) > width) {
el.removeClass("gnb_1dli_over").addClass("gnb_1dli_over2");
}
left += w1;
}
}
</script>
<?php