This commit is contained in:
rulingcom 2022-12-09 17:32:57 +08:00
parent fabf29a5bf
commit e2d576d7d9
1 changed files with 2 additions and 6 deletions

View File

@ -52,18 +52,14 @@
$('.layout-header').css('height', '');
var scrollTop = $(window).scrollTop();
if (!window.has_topest_banner){
$('.kenjohn').removeClass('navFixed').addClass('navRel');
$('.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'); /* 移除選單固定效果 */
}
$('.kenjohn').removeClass('navRel').removeClass('navFixed'); /* 移除選單固定效果 */
$('.layout-content').css('margin-top','');
}
}