Fix js bug.

This commit is contained in:
rulingcom 2022-01-03 15:09:02 +00:00
parent 2122111358
commit f192a42a7b
1 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@
var scrollTop = $(window).scrollTop(); var scrollTop = $(window).scrollTop();
var scrollBottom = $('html').height() - $(window).height() - $('.kenjohn').height(); var scrollBottom = $('html').height() - $(window).height() - $('.kenjohn').height();
if (scrollTop>5 && scrollBottom>0) { /* 要滑動到選單的距離 */ if (scrollTop>5 && scrollBottom>0) { /* 要滑動到選單的距離 */
if (parseInt($('.layout-content').css('margin-top'))==0 && $('.layout-content.topcontent').offset().top<400){ 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()); $('.layout-content').css('margin-top',$('.kenjohn').height()-$('#orbit-bar').height());
} }
$('.kenjohn').addClass('navFixed').removeClass('navRel'); /* 幫選單加上固定效果 */ $('.kenjohn').addClass('navFixed').removeClass('navRel'); /* 幫選單加上固定效果 */
@ -832,7 +832,7 @@ function transdate(){
var theTop; var theTop;
if (stop){ if (stop){
$(".kenjohn").addClass('navFixed'); $(".kenjohn").addClass('navFixed');
if ($('.layout-content.topcontent').offset().top<400){ if ($('.layout-content.topcontent').length != 0 && $('.layout-content.topcontent').offset().top<400){
$('.layout-content').css('margin-top',$('.kenjohn').height()-$('#orbit-bar').height()); $('.layout-content').css('margin-top',$('.kenjohn').height()-$('#orbit-bar').height());
} }
if (parseInt($('.layout-content').css('margin-top')==0)){ if (parseInt($('.layout-content').css('margin-top')==0)){