diff --git a/assets/javascripts/app.js b/assets/javascripts/app.js index 9b7997d..0d4c815 100644 --- a/assets/javascripts/app.js +++ b/assets/javascripts/app.js @@ -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);