This commit is contained in:
rulingcom 2022-12-09 17:31:42 +08:00
parent 2d58fed94d
commit f90bfd399c
1 changed files with 4 additions and 6 deletions

View File

@ -51,17 +51,15 @@
if ( $('.header-banner').length != 0 ) {
$('.layout-header').css('height', '');
var scrollTop = $(window).scrollTop();
if (!window.has_topest_banner || scrollTop>5) { /* 要滑動到選單的距離 */
if (!window.has_topest_banner){
$('.kenjohn').removeClass('navFixed').addClass('navRel');
}else 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());
}
$('.kenjohn').addClass('navFixed').removeClass('navRel'); /* 幫選單加上固定效果 */
} else {
if (!window.has_topest_banner) {
$('.kenjohn').removeClass('navFixed').addClass('navRel');
} else {
$('.kenjohn').removeClass('navRel').removeClass('navFixed'); /* 移除選單固定效果 */
}
$('.layout-content').css('margin-top','');
}
}