hello guys, i updated the js,
var getToValue = () => -(thisAnimWrap.scrollWidth - window.innerWidth) ; this changed the direction now its working fine, but the speed is very slow, and its not even reaches the end of the container. tried changing the end: value
const horizontalSections = gsap.utils.toArray('section.horizontalSec');
horizontalSections.forEach(function (sec, i) {
var thisPinWrap = sec.querySelector('.pinWrap');
var thisAnimWrap = thisPinWrap.querySelector('.horizontalWrap');
var getToValue = () => -(thisAnimWrap.scrollWidth - window.innerWidth) ;
gsap.fromTo(thisAnimWrap, {
x : 0
}, {
x: () => getToValue(),
ease: "none",
scrollTrigger: {
trigger: sec,
start: "top top",
end: () => "+=" + (thisAnimWrap.scrollWidth - window.innerWidth),
pin: thisPinWrap,
invalidateOnRefresh: true,
anticipatePin: 1,
scrub: 1,
markers: true,
dutation:1
}
});
});