|
|
|
@ -25,8 +25,7 @@
|
|
|
|
|
if ( $('.header-banner').length != 0) {
|
|
|
|
|
$('.layout-header').css('height', '');
|
|
|
|
|
var scrollTop = $(window).scrollTop();
|
|
|
|
|
var scrollBottom = $('html').height() - $(window).height() - $('.kenjohn').height();
|
|
|
|
|
if (scrollTop>5 && scrollBottom>0) { /* 要滑動到選單的距離 */
|
|
|
|
|
if (scrollTop>5) { /* 要滑動到選單的距離 */
|
|
|
|
|
if (parseInt($('.layout-content').css('margin-top'))==0 && $('.layout-content.topcontent').length != 0 && $('.layout-content.topcontent').offset().top<400){
|
|
|
|
|
$('.layout-content').css('margin-top',$('.kenjohn').height()-$('#orbit-bar').height());
|
|
|
|
|
}
|
|
|
|
@ -370,8 +369,19 @@
|
|
|
|
|
ClickMenuHandler: function() {
|
|
|
|
|
$('.navbar-toggle').click(function(e){
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
$('.mobile-menu').toggleClass('active');
|
|
|
|
|
$('body').toggleClass('noscroll');
|
|
|
|
|
if($('body').hasClass('noscroll')){
|
|
|
|
|
$('.mobile-menu').removeClass('active');
|
|
|
|
|
window.setTimeout(function(){
|
|
|
|
|
$('body').removeClass('noscroll');
|
|
|
|
|
$('body').css('top', '');
|
|
|
|
|
window.scroll(window.temp_scrollX, ($('body').data('org-scrollY') || 0));
|
|
|
|
|
},400);
|
|
|
|
|
}else{
|
|
|
|
|
$('body').data('org-scrollY', window.temp_scrollY);
|
|
|
|
|
$('body').css('top', '-' + window.temp_scrollY.toString() + 'px');
|
|
|
|
|
$('body').addClass('noscroll');
|
|
|
|
|
$('.mobile-menu').addClass('active');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$('.mobile-menu .navbar-toggle').removeClass('collapsed');
|
|
|
|
|
// $menu.slideToggle();
|
|
|
|
@ -753,15 +763,15 @@ function transdate(){
|
|
|
|
|
window.clearTimeout(window.focus_timeout_id);
|
|
|
|
|
}
|
|
|
|
|
var _this = $(document.activeElement);//$(this);
|
|
|
|
|
if(!_this.hasClass('close-screen-btn')){
|
|
|
|
|
var topOffset = window.temp_scrollY + window.top_barrier_height;
|
|
|
|
|
var ele_offset = _this.offset().top - topOffset;
|
|
|
|
|
if($('body').css('position') != 'fixed' && !_this.hasClass('close-screen-btn') && !_this.hasClass('navbar-toggle')){
|
|
|
|
|
var ele_offset = _this[0].getBoundingClientRect().top - window.top_barrier_height;
|
|
|
|
|
console.log(_this, ele_offset)
|
|
|
|
|
if(ele_offset < 0){
|
|
|
|
|
window.scroll(window.temp_scrollX, window.temp_scrollY + ele_offset);
|
|
|
|
|
window.temp_scrollY = Math.max(window.temp_scrollY + ele_offset, 0);
|
|
|
|
|
}
|
|
|
|
|
window.focus_timeout_id = window.setTimeout(function(){
|
|
|
|
|
var ele_offset = _this.offset().top - topOffset;
|
|
|
|
|
var ele_offset = _this[0].getBoundingClientRect().top - window.top_barrier_height;
|
|
|
|
|
if(ele_offset < 0){
|
|
|
|
|
window.scroll(window.temp_scrollX, window.temp_scrollY + ele_offset);
|
|
|
|
|
window.temp_scrollY = Math.max(window.temp_scrollY + ele_offset, 0);
|
|
|
|
|