It seems like there might be an issue with the code you provided. The scrollTo method, as part of Locomotive Scroll library, does not have an option called disableLerp. It might be causing an error, leading to the scroll container disappearing.

Here's an updated version of your code that should work without any issues:

const pg = document.querySelector('.qq_top_list');
scrollQ.scrollTo(pg, {
    offset: 0,
    duration: 0
});

Make sure you have correctly initialized the Locomotive Scroll library and assigned the scrollQ variable to the instance of Locomotive Scroll.

If the issue persists, please provide more details or share additional code snippets related to the scroll container and its parent elements, so we can better understand the problem and help you troubleshoot it

this is my code for locomotive scrollconst pg= documentquerySelectorqq_top_list;scrollQscrollTo pg 	offset 0	duration 0	disableLerp true ;after run this code the scroll container is locked and disapea

原文地址: https://www.cveoy.top/t/topic/it9q 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录