fix error

This commit is contained in:
chiu 2021-09-02 13:42:28 +08:00
parent f286c6a2eb
commit 05b4f8bc8b
1 changed files with 6 additions and 1 deletions

View File

@ -802,7 +802,12 @@ function transdate(){
$(".kenjohn").addClass('navFixed');
$('.layout-content').css('margin-top',$('.kenjohn').height());
window.setTimeout(function(){
var theTop = $('.layout-content-inner.container').offset().top-$(".kenjohn").position().top-$(".kenjohn").height()+10;
var theTop;
if (parseInt($('.layout-content').css('margin-top')==0){
theTop = $('.layout-content-inner.container').offset().top-$(".kenjohn").position().top+10;
}else{
theTop = $('.layout-content-inner.container').offset().top-$(".kenjohn").position().top-$(".kenjohn").height()+10;
}
$("html, body").animate({
scrollTop: theTop }, {duration: 500,easing: "swing"});
},100);