"(max-width: 767px)": function() {
let sections = document.querySelectorAll(".activities_sec .image");
let scrollContainer = document.querySelector(".activities_sec");
let scrollTween = gsap.to(sections, {
xPercent: -110 * (sections.length - 1),
ease: "none"
});
let horizontalScroll = ScrollTrigger.create({
animation: scrollTween,
trigger: scrollContainer,
pin: true,
scrub: 1,
end: "+=1000"
});
// total scroll amount divided by the total distance that the sections move gives us the ratio we can apply to the pointer movement so that it fits.
var dragRatio = scrollContainer.offsetWidth / (window.innerWidth * (sections.length - 1));
var drag = Draggable.create(".proxy", {
trigger: scrollContainer,
type: "x",
onPress() {
this.startScroll = horizontalScroll.scroll();
},
onDrag() {
horizontalScroll.scroll(this.startScroll - (this.x - this.startX) * 1);
// if you don't want it to lag at all while dragging (due to the 1-second scrub), uncomment the next line:
//horizontalScroll.getTween().progress(1);
}
})[0];
},
if i remove this script then all animation working perfectly