1.diy滚动监听优化

master
sws 2024-12-26 16:31:56 +08:00
parent b8a14c2d75
commit 096b85b73c
2 changed files with 5 additions and 3 deletions

View File

@ -567,9 +567,11 @@
//
on_scroll_event(e) {
const scroll_num = e.detail.scrollTop;
if ((scroll_num - 20) / (this.sticky_top + 33) <= 1) {
if (scroll_num / (this.sticky_top + 33) <= 1) {
//
this.scroll_top = scroll_num;
} else {
this.scroll_top = this.sticky_top + 100;
}
this.scroll_timer_compute(scroll_num);
},

View File

@ -209,10 +209,10 @@
const gradient = { color_list: up_slide_background_color_list, direction: up_slide_background_direction };
//
const back = { background_img: up_slide_background_img, background_img_style: up_slide_background_img_style };
const up_slide_opacity = 'opacity:' + ((newVal - 20) / (this.header_top + 33) > 1 ? 1 : ((newVal - 20) / (this.header_top + 33)).toFixed(2)) + ';';
const up_slide_opacity = 'opacity:' + ((newVal - 20) / this.header_top > 1 ? 1 : ((newVal - 20) / this.header_top).toFixed(2)) + ';';
this.up_slide_opacity = up_slide_opacity;
// logologo
this.up_slide_old_logo_style = 'opacity:' + ((newVal - 5) / (this.header_top + 33) > 1 ? 0 : (1 - (newVal - 5) / (this.header_top + 33)).toFixed(2)) + ';';
this.up_slide_old_logo_style = 'opacity:' + ((newVal - 5) / this.header_top > 1 ? 0 : (1 - (newVal - 5) / this.header_top).toFixed(2)) + ';';
// =0
this.up_slide_style = gradient_computer(gradient) + up_slide_opacity;
this.up_slide_img_style = background_computer(back);