# P5 JS is not compatible with GSAP smooth scroller

**URL:** <https://discourse.processing.org/t/p5-js-is-not-compatible-with-gsap-smooth-scroller/45472>\
**Category:** p5.js\
**Created:** [December 17, 2024, 10:29am UTC](https://discourse.processing.org/t/p5-js-is-not-compatible-with-gsap-smooth-scroller/45472 "2024-12-17T10:29:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SanjaySubba](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@SanjaySubba](https://discourse.processing.org/u/SanjaySubba)\
**Post date:** [December 17, 2024, 10:29am UTC](https://discourse.processing.org/t/p5-js-is-not-compatible-with-gsap-smooth-scroller/45472/1 "2024-12-17T10:29:56Z")

</div>

I have integrated smooth scroller and p5 js in my website. It is working fine in other browsers except in safari. The scroll is stucked in safari browser and I am unable to scroll.

Here is the minimal demo in codepen integrating both p5 and GSAP.

https://codepen.io/devSanjay/embed/preview/vEByEoM?default-tabs=js%2Cresult&height=300&host=https%3A%2F%2Fcodepen.io&slug-hash=vEByEoM

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [December 17, 2024, 2:44pm UTC](https://discourse.processing.org/t/p5-js-is-not-compatible-with-gsap-smooth-scroller/45472/2 "2024-12-17T14:44:44Z")

</div>

I’m using Safari on MacOS and it seems to work ok here.

 ![scrl](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/e/2/e2fc1db5e364e7c6db2efb6b52c241d9ba27535c.png)

---

<div class="post-metadata">

**Author:** ![SanjaySubba](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@SanjaySubba](https://discourse.processing.org/u/SanjaySubba)\
**Post date:** [December 17, 2024, 3:24pm UTC](https://discourse.processing.org/t/p5-js-is-not-compatible-with-gsap-smooth-scroller/45472/3 "2024-12-17T15:24:57Z")

</div>

did you scroll using touchpad/mouse? were you able to scroll?

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [December 17, 2024, 4:34pm UTC](https://discourse.processing.org/t/p5-js-is-not-compatible-with-gsap-smooth-scroller/45472/4 "2024-12-17T16:34:24Z")

</div>

I grabbed the ‘thumb’ with my mouse (left click). Wheel does not work.

---

<div class="post-metadata">

**Author:** ![SanjaySubba](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@SanjaySubba](https://discourse.processing.org/u/SanjaySubba)\
**Post date:** [December 17, 2024, 4:49pm UTC](https://discourse.processing.org/t/p5-js-is-not-compatible-with-gsap-smooth-scroller/45472/5 "2024-12-17T16:49:08Z")

</div>

That’s the problem. The problem is my mouse scroller / touchpad doesn’t work. Something in between p5 and GSAP smooth scroller is conflicting. I want to know if p5 does anything with scroll event.

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [December 17, 2024, 4:57pm UTC](https://discourse.processing.org/t/p5-js-is-not-compatible-with-gsap-smooth-scroller/45472/6 "2024-12-17T16:57:59Z")

</div>

p5 has a mouseWheel function. You’ve probably already seen the documentation:  
[https://p5js.org/reference/p5/mouseWheel/](https://p5js.org/reference/p5/mouseWheel/)
