mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-19 03:09:55 +09:00
Issue 2444. GNB vertical toggle. GMB mobile toggle. #site vertical height resize.
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11431 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
dd7a630a3b
commit
5e596ba61e
8 changed files with 264 additions and 74 deletions
|
|
@ -39,18 +39,19 @@ jQuery(function($){
|
|||
var $xGnb_li = $xGnb.find('>ul>li');
|
||||
$(window).resize(function(){
|
||||
setTimeout(function(){
|
||||
if($(window).width() >= 980){ // Over than 1024px
|
||||
$xGnb.height('auto').height($xBody.height());
|
||||
} else { // Less than 1024
|
||||
$xGnb.height('auto');
|
||||
if($(window).width() < 980 || $(window).width() > 1240){
|
||||
$xBody.removeClass('wide');
|
||||
} else {
|
||||
$xBody.addClass('wide');
|
||||
}
|
||||
if($(window).width() < 980){
|
||||
$xBody.addClass('mobile');
|
||||
}
|
||||
}, 100);
|
||||
}).resize();
|
||||
// GNB Click toggle
|
||||
// Add virtual class
|
||||
$xGnb_li.find('>ul').prev('a').addClass('virtual');
|
||||
// Virtual click
|
||||
$xGnb_li.find('>a.virtual')
|
||||
$xGnb_li.find('>a').not('[href="#gnb"]') //.virtual
|
||||
.bind('click focus', function(){
|
||||
var $this = $(this);
|
||||
// Submenu toggle
|
||||
|
|
@ -58,6 +59,8 @@ jQuery(function($){
|
|||
$xGnb_li.not($this.parent('li')).removeClass('open');
|
||||
$(this).parent('li').toggleClass('open');
|
||||
}
|
||||
$xGnb.trigger('mouseenter'); // GNB Hover
|
||||
$(window).resize();
|
||||
return false;
|
||||
});
|
||||
// Toggle all
|
||||
|
|
@ -70,5 +73,43 @@ jQuery(function($){
|
|||
$xGnb_li.removeClass('open');
|
||||
$xGnb.removeClass('all');
|
||||
}
|
||||
})
|
||||
.focus(function(){
|
||||
$xGnb.trigger('mouseenter'); // GNB Hover
|
||||
});
|
||||
// GNB Hover toggle
|
||||
function contentBugFix(){ // Chrome browser rendering bug fix
|
||||
$xContent.width('99.99%');
|
||||
setTimeout(function(){
|
||||
$xContent.removeAttr('style');
|
||||
}, 0);
|
||||
}
|
||||
$xGnb
|
||||
.mouseenter(function(){ // Mouseenter
|
||||
if($(window).width() >= 980){
|
||||
setTimeout(function(){
|
||||
$xBody.removeClass('wide');
|
||||
contentBugFix();
|
||||
}, 200);
|
||||
}
|
||||
})
|
||||
.mouseleave(function(){ // Mouseleave
|
||||
if($(window).width() >= 980 && $(window).width() < 1240){
|
||||
$xBody.addClass('wide');
|
||||
contentBugFix();
|
||||
}
|
||||
});
|
||||
// GNB Mobile Toggle
|
||||
$xGnb.find('>a[href="#gnbNav"]').click(function(){
|
||||
$(this).parent('.gnb').toggleClass('open');
|
||||
return false;
|
||||
});
|
||||
// GNB Close
|
||||
$xGnb
|
||||
.prepend('<button type="button" class="close before" />')
|
||||
.append('<button type="button" class="close after" />');
|
||||
$xGnb.find('>.close').focus(function(){
|
||||
$xBody.addClass('wide');
|
||||
contentBugFix();
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue