@ZachSaucier Hello Zach thank you so much, yea it does seems complicated for a beginner like me
how ever when i add loading lazy there is an issue with scrolling since i'm using scrollTrigger to achieve smooth scrolling for the whole website
just for you to remember here is the code i copied from another post on here to achieve whole page smooth transition
JS
gsap.registerPlugin(ScrollTrigger, ScrollToPlugin);
function smoothScroll() {
const container = document.querySelector('#_layout');
let height;
function setHeight() {
height = container.clientHeight;
document.body.style.height = `${height}px`;
}
ScrollTrigger.addEventListener('refreshInit', setHeight);
gsap.to(container, {
y: () => -(height - document.documentElement.clientHeight),
ease: 'none',
scrollTrigger: {
trigger: document.body,
start: 'top top',
end: 'bottom bottom',
scrub: 0.9,
invalidateOnRefresh: true,
},
});
}
smoothScroll();
HTML
<main id="_app">
<div id="_layout">
<!-- content -->
</div>
</main>
CSS
#_app {
width: 100vw;
height: 100vh;
overflow: hidden;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
#_layout {
padding: 1.5vw;
margin: 0 auto;
overflow: hidden;
}
If the question is complicated or annoying please ignore it,
if you just can explain to me why there is scrolling issues when i add loading lazy with this code
what happens is when i scroll i can't see the section where i added loading lazy to the images
like the scrollbar comes to and end early on like this section doesn't exist
thank you in advance