This commit is contained in:
chiu 2021-09-02 15:21:58 +08:00
parent 4f5e240e1b
commit 5811b8f504
1 changed files with 18 additions and 10 deletions

View File

@ -799,21 +799,29 @@ function transdate(){
}); });
$('.modules-menu-level-1').css('left','-'+$('.outdropdowns .dropdowns').offset().left+'px'); $('.modules-menu-level-1').css('left','-'+$('.outdropdowns .dropdowns').offset().left+'px');
$(".downIcon").click(function() { $(".downIcon").click(function() {
var move_to_target=function (m) { var move_to_target=function (stop) {
var theTop;
if (stop){
$(".kenjohn").addClass('navFixed'); $(".kenjohn").addClass('navFixed');
$('.layout-content').css('margin-top',$('.kenjohn').height()); $('.layout-content').css('margin-top',$('.kenjohn').height());
var theTop;
if (parseInt($('.layout-content').css('margin-top')==0)){ if (parseInt($('.layout-content').css('margin-top')==0)){
theTop = $('.layout-content-inner.container').offset().top-$(".kenjohn").position().top+10; theTop = $('.layout-content-inner.container').offset().top-$(".kenjohn").position().top+10;
}else{ }else{
theTop = $('.layout-content-inner.container').offset().top-$(".kenjohn").position().top-$(".kenjohn").height()+10; theTop = $('.layout-content-inner.container').offset().top-$(".kenjohn").position().top-$(".kenjohn").height()+10;
} }
$("html, body").animate({ }else{
scrollTop: theTop - m }, {duration: 500,easing: "swing"},function(){ theTop = 10;
move_to_target(0);
});
} }
move_to_target(50); console.log(theTop);
$("html, body").animate({
scrollTop: theTop }, {duration: 500,easing: "swing",complete: function(){
console.log('finish');
if(!stop){
move_to_target(true);
}
}});
}
move_to_target(false);
return false; return false;
}); });