diff --git a/assets/javascripts/app.js b/assets/javascripts/app.js index 8fdd4d3..042e94c 100644 --- a/assets/javascripts/app.js +++ b/assets/javascripts/app.js @@ -799,8 +799,9 @@ function transdate(){ }); $('.modules-menu-level-1').css('left','-'+$('.outdropdowns .dropdowns').offset().left+'px'); $(".downIcon").click(function() { - $(".kenjohn").addClass('navFixed'); - window.setTimeout(function(){ + var move_to_target=function (m) { + $(".kenjohn").addClass('navFixed'); + $('.layout-content').css('margin-top',$('.kenjohn').height()); var theTop; if (parseInt($('.layout-content').css('margin-top')==0)){ theTop = $('.layout-content-inner.container').offset().top-$(".kenjohn").position().top+10; @@ -808,8 +809,11 @@ function transdate(){ theTop = $('.layout-content-inner.container').offset().top-$(".kenjohn").position().top-$(".kenjohn").height()+10; } $("html, body").animate({ - scrollTop: theTop }, {duration: 500,easing: "swing"}); - },100); + scrollTop: theTop - m }, {duration: 500,easing: "swing"},function(){ + move_to_target(0); + }); + } + move_to_target(50); return false; });