//グローバルナビイージング $(document).ready(function(){ showSNavigation(); }); var showSNavigation = function(){ var $element; var $headerHeight; var $navigationHeight; var $bcnaviHeight; var $SNavigationHeight; var $scrollLengthSNavigation; var $windowScrollLength; var $showSNavigationFlag; $element = $('#gNavWrapper'); $headerHeight = $('#gNavWrapper').height(); $navigationHeight = $('#navigation').height(); $bcnaviHeight = $('#bcnavi').height(); $SNavigationHeight = $('#gNav').height(); $scrollLengthSNavigation = $headerHeight + $navigationHeight + $bcnaviHeight; $element.css({ display: 'block' }) $showSNavigationFlag = false; $(window).scroll(function(){ $windowScrollLength = $(this).scrollTop(); if( $windowScrollLength >= $scrollLengthSNavigation ) { if( !$showSNavigationFlag ) { $showSNavigationFlag = true; $element.stop().animate({ top: 0 }, 400, 'easeOutCubic' ); } } else { $showSNavigationFlag = false; $element.stop().animate({ top : 18 }, 10, 'easeOutCubic' ); } }); } //グローバルナビ開閉 var conf = { gnavParent: '#gNav > dl > dd > ul > li', gNavChild: 'div.gNavChild', motion: 200, } gNav = function(){ if ($(conf.gnavParent).size() > 0) { megaMenu(); } } // タイマーをセット setTimerSlider = function($obj, idx) { if (global.sliderActionFlag[idx] != undefined) { global.sliderTimerId[idx] = setInterval(function(){ actionNextSlider($obj, idx); }, conf.sliderIntervalTime); } } // タイマーを解除 clearTimerSlider = function(idx) { if (global.sliderActionFlag[idx] != undefined) { clearInterval(global.sliderTimerId[idx]); } } megaMenu = function() { eventMegaMenu(); } eventMegaMenu = function() { $(conf.gnavParent).hover( function(){ if ($(this).find(conf.gNavChild).size() > 0) { $(this).find(conf.gNavChild).slideDown(conf.motion); } }, function(){ if ($(this).find(conf.gNavChild).size() > 0) { $(this).find(conf.gNavChild).hide(); } } ); } $(function(){ gNav(); });