fix error

This commit is contained in:
chiu committed 2021-09-02 13:42:28 +08:00
1 parent f286c6a2eb
commit 05b4f8bc8b
1 file changed
+6 -1
+6 -1
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);