Locomotive Scroll ScrollTo Method Not Working - Scroll Container Disappears
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.
原文地址: https://www.cveoy.top/t/topic/qbJE 著作权归作者所有。请勿转载和采集!