测试反馈修改完成

master
Lee-1203 2022-02-14 17:09:21 +08:00
parent 5eaa181e89
commit bf89e47760
2 changed files with 56 additions and 5 deletions

View File

@ -332,6 +332,11 @@
<script type="text/javascript">
if(screen.width <= 980){
let navTop = $(".pull-item").offset().top-70;
let abstractTop = $(".abstract-bg").offset().top-129;
let speechTop = $(".speech-bg").offset().top-129;
let teamTop = $(".team-bg").offset().top-129;
let organizationTop = $(".organization-bg").offset().top-129;
let memorabiliaTop = $(".memorabilia-bg").offset().top-129;
$(window).bind("scroll",function(){
let topScroll=$(this).scrollTop();//当前窗口的滚动距离
if(topScroll > navTop){
@ -339,9 +344,35 @@
}else{
$(".pull-item").removeClass("pull-item-fixed")
}
if(topScroll > abstractTop){
$(".pull-item li").removeClass("cur");
$(".abstract-btn").addClass("cur");
}
if(topScroll > abstractTop & topScroll > speechTop){
$(".pull-item li").removeClass("cur");
$(".speech-btn").addClass("cur");
}
if(topScroll > abstractTop & topScroll > speechTop & topScroll > teamTop){
$(".pull-item li").removeClass("cur");
$(".team-btn").addClass("cur");
}
if(topScroll > abstractTop & topScroll > speechTop & topScroll > teamTop & topScroll > organizationTop){
$(".pull-item li").removeClass("cur");
$(".organization-btn").addClass("cur");
}
if(topScroll > abstractTop & topScroll > speechTop & topScroll > teamTop & topScroll > organizationTop & topScroll > memorabiliaTop){
$(".pull-item li").removeClass("cur");
$(".memorabilia-btn").addClass("cur");
}
});
}else{
let navTop = $(".pull-item").offset().top-90;
let abstractTop = $(".abstract-bg").offset().top-149;
let speechTop = $(".speech-bg").offset().top-149;
let teamTop = $(".team-bg").offset().top-149;
let organizationTop = $(".organization-bg").offset().top-149;
let memorabiliaTop = $(".memorabilia-bg").offset().top-149;
$(window).bind("scroll",function(){
let topScroll=$(this).scrollTop();//当前窗口的滚动距离
if(topScroll > navTop){
@ -349,6 +380,26 @@
}else{
$(".pull-item").removeClass("pull-item-fixed")
}
if(topScroll > abstractTop){
$(".pull-item li").removeClass("cur");
$(".abstract-btn").addClass("cur");
}
if(topScroll > abstractTop & topScroll > speechTop){
$(".pull-item li").removeClass("cur");
$(".speech-btn").addClass("cur");
}
if(topScroll > abstractTop & topScroll > speechTop & topScroll > teamTop){
$(".pull-item li").removeClass("cur");
$(".team-btn").addClass("cur");
}
if(topScroll > abstractTop & topScroll > speechTop & topScroll > teamTop & topScroll > organizationTop){
$(".pull-item li").removeClass("cur");
$(".organization-btn").addClass("cur");
}
if(topScroll > abstractTop & topScroll > speechTop & topScroll > teamTop & topScroll > organizationTop & topScroll > memorabiliaTop){
$(".pull-item li").removeClass("cur");
$(".memorabilia-btn").addClass("cur");
}
});
};
</script>

View File

@ -152,27 +152,27 @@ jQuery(function($){
// 走进蜀能锚点
if(screen.width <= 980){
$('.abstract-btn').click(function(){
$('html,body').animate({scrollTop:$('.abstract-bg').offset().top - 128}, 600);
$('html,body').animate({scrollTop:$('.abstract-bg').offset().top - 128}, 300);
$('.pull-item>li').removeClass("cur");
$(this).addClass("cur");
});
$('.speech-btn').click(function(){
$('html,body').animate({scrollTop:$('.speech-bg').offset().top - 128}, 600);
$('html,body').animate({scrollTop:$('.speech-bg').offset().top - 128}, 300);
$('.pull-item>li').removeClass("cur");
$(this).addClass("cur");
});
$('.team-btn').click(function(){
$('html,body').animate({scrollTop:$('.team-bg').offset().top - 128}, 600);
$('html,body').animate({scrollTop:$('.team-bg').offset().top - 128}, 300);
$('.pull-item>li').removeClass("cur");
$(this).addClass("cur");
});
$('.organization-btn').click(function(){
$('html,body').animate({scrollTop:$('.organization-bg').offset().top - 128}, 600);
$('html,body').animate({scrollTop:$('.organization-bg').offset().top - 128}, 300);
$('.pull-item>li').removeClass("cur");
$(this).addClass("cur");
});
$('.memorabilia-btn').click(function(){
$('html,body').animate({scrollTop:$('.memorabilia-bg').offset().top - 128}, 600);
$('html,body').animate({scrollTop:$('.memorabilia-bg').offset().top - 128}, 300);
$('.pull-item>li').removeClass("cur");
$(this).addClass("cur");
});