GNB UI enhancement.

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11699 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ChanMyeong 2012-10-15 06:27:10 +00:00
parent bd6c98b33f
commit 3160451de0
5 changed files with 1336 additions and 62 deletions

View file

@ -22,7 +22,7 @@
<div class="body wide">
<!-- GNB -->
<nav class="gnb" id="gnb">
<a href="#gnbNav"><i class="x_icon-align-justify"></i> 메뉴열기/닫기</a>
<a href="#gnbNav"><i class="x_icon-align-justify x_icon-white"></i> 메뉴열기/닫기</a>
<ul id="gnbNav">
<li loop="$gnbUrlList=>$key,$value" class="active open"|cond="$parentSrl==$key || $value['href']=='index.php?module=admin' && !$mid && !$act"><a href="{getFullUrl('')}{$value['href']}"><span class="tx">{$value['text']}</span></a>
<ul cond="count($value['list'])">

View file

@ -196,6 +196,7 @@ to{-o-transform:rotate(360deg)}
.x>.body>.gnb>.close{background:none;border:0;position:absolute;top:0;left:0;width:100%;height:1px;overflow:hidden;margin:0;padding:0}
.x>.body>.gnb ul{margin:0;padding:0;list-style:none}
.x>.body>.gnb>ul{position:relative;z-index:1;box-shadow:2px 2px 4px #ddd}
.x>.body>.gnb>ul>li.active_{display:none}
.x>.body>.gnb a{text-decoration:none;text-shadow:0 1px 0 #fff;color:#000;display:block}
.x>.body>.gnb>a[href="#gnbNav"]{display:block;position:absolute;z-index:2;white-space:nowrap;font-size:0;top:50%;right:-14px;background:#eee;width:12px;height:50px;border-radius:0 3px 3px 0;margin:-25px 0 0 0;border:1px solid #ddd;border-left:0}
.x>.body.wide>.gnb>a[href="#gnbNav"]:after{border-color:transparent;border-left-color:#666;margin:-4px 0 0 -2px}
@ -207,12 +208,13 @@ to{-o-transform:rotate(360deg)}
.x>.body>.gnb.open>ul>li{display:block}
.x>.body>.gnb>a[href="#gnbNav"],
.x>.body.wide>.gnb>a[href="#gnbNav"]{top:0;right:0;line-height:37px;width:44px;height:auto;background:none;border-radius:0;margin:0;border:0}
.x>.body>.gnb>a[href="#gnbNav"]:before{content:"";position:absolute;top:1px;width:1px;height:100%;border-left:1px solid #ccc;opacity:.5;filter:alpha(opacity=50%)}
.x>.body>.gnb>a[href="#gnbNav"]{opacity:.5;filter:alpha(opacity=50%)}
.x>.body>.gnb>a[href="#gnbNav"]:before{content:"";position:absolute;top:1px;width:1px;height:100%;border-left:1px solid #999}
.x>.body>.gnb>a[href="#gnbNav"]:after{content:normal}
.x>.body>.gnb>a>i{display:block;position:absolute;top:50%;left:50%;margin:-7px 0 0 -7px}
}
/* li */
.x>.body>.gnb>ul>li{background:#94a55c;border-top:1px solid #fff;border-bottom:1px solid #ddd;vertical-align:top;white-space:nowrap}
.x>.body>.gnb>ul>li{background:#3886d0;border-top:1px solid #fff;border-bottom:1px solid #ddd;vertical-align:top;white-space:nowrap}
.x>.body>.gnb>ul>li.active{background:#222}
.x>.body>.gnb>ul>li.open,
.x>.body>.gnb>ul>li.active{border-bottom:0;padding:0 0 1px 0}
@ -228,7 +230,7 @@ to{-o-transform:rotate(360deg)}
.x>.body>.gnb>ul>li>a[href="#favorite"]:before{background-position:-120px 0}
.x>.body>.gnb>ul>li>a:hover,
.x>.body>.gnb>ul>li>a:focus{background:#f6f6f6;background:-webkit-gradient(linear,left top,left bottom,from(#f6f6f6),to(#F1F1F1));background:-moz-linear-gradient(top,#f6f6f6,#F1F1F1);background:-o-linear-gradient(top,#f6f6f6,#F1F1F1)}
.x>.body>.gnb>ul>li.open>a{font-weight:bold;color:#fff;text-shadow:0 -1px 0 #333;background:#94a55c;background:-webkit-gradient(linear,left top,left bottom,from(#b3d155),to(#94a55c));background:-moz-linear-gradient(top,#b3d155,#94a55c);background:-o-linear-gradient(top,#b3d155,#94a55c)}
.x>.body>.gnb>ul>li.open>a{font-weight:bold;color:#fff;text-shadow:0 -1px 0 #333;background:#3886d0;background:-webkit-gradient(linear,left top,left bottom,from(#6ebcea),to(#3886d0));background:-moz-linear-gradient(top,#6ebcea,#3886d0);background:-o-linear-gradient(top,#6ebcea,#3886d0)}
.x>.body>.gnb>ul>li.active>a{font-weight:bold;color:#fff;text-shadow:none;background:#222;background:-webkit-gradient(linear,left top,left bottom,from(#555),to(#222));background:-moz-linear-gradient(top,#555,#222);background:-o-linear-gradient(top,#555,#222)}
/* li>a>span */
.x>.body.wide>.gnb>ul>li>a>.tx{display:inline-block;width:1px;height:1px;overflow:hidden}

View file

@ -196,6 +196,7 @@ to{-o-transform:rotate(360deg)}
.x>.body>.gnb>.close{background:none;border:0;position:absolute;top:0;left:0;width:100%;height:1px;overflow:hidden;margin:0;padding:0}
.x>.body>.gnb ul{margin:0;padding:0;list-style:none}
.x>.body>.gnb>ul{position:relative;z-index:1;box-shadow:2px 2px 4px #ddd}
.x>.body>.gnb>ul>li.active_{display:none}
.x>.body>.gnb a{text-decoration:none;text-shadow:0 1px 0 #fff;color:#000;display:block}
.x>.body>.gnb>a[href="#gnbNav"]{display:block;position:absolute;z-index:2;white-space:nowrap;font-size:0;top:50%;right:-14px;background:#eee;width:12px;height:50px;border-radius:0 3px 3px 0;margin:-25px 0 0 0;border:1px solid #ddd;border-left:0}
.x>.body.wide>.gnb>a[href="#gnbNav"]:after{border-color:transparent;border-left-color:#666;margin:-4px 0 0 -2px}
@ -207,12 +208,13 @@ to{-o-transform:rotate(360deg)}
.x>.body>.gnb.open>ul>li{display:block}
.x>.body>.gnb>a[href="#gnbNav"],
.x>.body.wide>.gnb>a[href="#gnbNav"]{top:0;right:0;line-height:37px;width:44px;height:auto;background:none;border-radius:0;margin:0;border:0}
.x>.body>.gnb>a[href="#gnbNav"]:before{content:"";position:absolute;top:1px;width:1px;height:100%;border-left:1px solid #ccc;opacity:.5;filter:alpha(opacity=50%)}
.x>.body>.gnb>a[href="#gnbNav"]{opacity:.5;filter:alpha(opacity=50%)}
.x>.body>.gnb>a[href="#gnbNav"]:before{content:"";position:absolute;top:1px;width:1px;height:100%;border-left:1px solid #999}
.x>.body>.gnb>a[href="#gnbNav"]:after{content:normal}
.x>.body>.gnb>a>i{display:block;position:absolute;top:50%;left:50%;margin:-7px 0 0 -7px}
}
/* li */
.x>.body>.gnb>ul>li{background:#94a55c;border-top:1px solid #fff;border-bottom:1px solid #ddd;vertical-align:top;white-space:nowrap}
.x>.body>.gnb>ul>li{background:#3886d0;border-top:1px solid #fff;border-bottom:1px solid #ddd;vertical-align:top;white-space:nowrap}
.x>.body>.gnb>ul>li.active{background:#222}
.x>.body>.gnb>ul>li.open,
.x>.body>.gnb>ul>li.active{border-bottom:0;padding:0 0 1px 0}
@ -228,7 +230,7 @@ to{-o-transform:rotate(360deg)}
.x>.body>.gnb>ul>li>a[href="#favorite"]:before{background-position:-120px 0}
.x>.body>.gnb>ul>li>a:hover,
.x>.body>.gnb>ul>li>a:focus{background:#f6f6f6;background:-webkit-gradient(linear,left top,left bottom,from(#f6f6f6),to(#F1F1F1));background:-moz-linear-gradient(top,#f6f6f6,#F1F1F1);background:-o-linear-gradient(top,#f6f6f6,#F1F1F1)}
.x>.body>.gnb>ul>li.open>a{font-weight:bold;color:#fff;text-shadow:0 -1px 0 #333;background:#94a55c;background:-webkit-gradient(linear,left top,left bottom,from(#b3d155),to(#94a55c));background:-moz-linear-gradient(top,#b3d155,#94a55c);background:-o-linear-gradient(top,#b3d155,#94a55c)}
.x>.body>.gnb>ul>li.open>a{font-weight:bold;color:#fff;text-shadow:0 -1px 0 #333;background:#3886d0;background:-webkit-gradient(linear,left top,left bottom,from(#6ebcea),to(#3886d0));background:-moz-linear-gradient(top,#6ebcea,#3886d0);background:-o-linear-gradient(top,#6ebcea,#3886d0)}
.x>.body>.gnb>ul>li.active>a{font-weight:bold;color:#fff;text-shadow:none;background:#222;background:-webkit-gradient(linear,left top,left bottom,from(#555),to(#222));background:-moz-linear-gradient(top,#555,#222);background:-o-linear-gradient(top,#555,#222)}
/* li>a>span */
.x>.body.wide>.gnb>ul>li>a>.tx{display:inline-block;width:1px;height:1px;overflow:hidden}

View file

@ -10,11 +10,12 @@ jQuery(function($){
$(document.body).on('click', '.x [data-toggle]', function(){
var $this = $(this);
var $target = $($this.attr('data-toggle'));
var focusable = 'a,input,button,textarea,select';
$target.toggle();
if($target.is(':visible') && !$target.find('a,input,button,textarea,select').length){
if($target.is(':visible') && !$target.find(focusable).length){
$target.attr('tabindex','0').focus();
} else if($target.is(':visible') && $target.find('a,input,button,textarea,select').length) {
$target.find('a,input,button,textarea,select').eq(0).focus();
} else if($target.is(':visible') && $target.find(focusable).length) {
$target.find(focusable).eq(0).focus();
} else {
$this.focus();
}
@ -45,29 +46,32 @@ jQuery(function($){
var $xContent = $xBody.children('#content.content');
var $xGnb = $xBody.find('>.gnb');
var $xGnb_li = $xGnb.find('>ul>li');
// Active Submenu Copy
$xGnb_li.find('>ul>li.active_').clone().addClass('active').prependTo('#gnbNav');
// GNB Hover toggle
function contentBugFix(){ // Chrome browser rendering bug fix
function reflow(){ // Chrome browser rendering bug fix
$xContent.width('99.99%');
setTimeout(function(){
$xContent.removeAttr('style');
}, 0);
if($xGnb.height() > $xContent.height()){
$xContent.height($xGnb.height());
}
}, 100);
}
// GNB Click toggle
$xGnb_li.find('ul').prev('a')
.bind('click focus', function(){
var $this = $(this);
// Submenu toggle
$xGnb_li.not($this.parent('li')).removeClass('open');
$(this).parent('li').toggleClass('open');
$this.parent('li').addClass('open').siblings('li').removeClass('open');
$xBody.removeClass('wide');
contentBugFix();
reflow();
return false;
});
// GNB Mobile Toggle
$xGnb.find('>a[href="#gnbNav"]').click(function(){
$(this).parent('.gnb').toggleClass('open');
$xBody.toggleClass('wide');
contentBugFix();
reflow();
return false;
});
// GNB Close
@ -76,7 +80,7 @@ jQuery(function($){
.append('<button type="button" class="close after" />');
$xGnb.find('>.close').focus(function(){
$xBody.addClass('wide');
contentBugFix();
reflow();
});
// Check All
$('.x th>input[type="checkbox"]')

File diff suppressed because it is too large Load diff