Sanjero
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by Sanjero
-
-
4 hours ago, GreenSock said:
Done. No problems whatsoever.
Thank you for your reply, I will try to figure the issue out and let you know.
-
Thank you for your reply.
Don't try it on codepen, just paste the code in a HTML file, import the jquery then try.
-
Hi,
I have a issue with using GSAP and jQuery at same time.
My GSAP code is working fine without jQuery but once I import jQuery to the index page I face the below strange behavior:
When I refresh the page, GSAP losing the scroll position.
Please open the below URL and scroll down to see the section animations, then refresh the page and try scrolling from top, you will see the issue.
I used the below code to prevent the browser from saving the scroll position on refreshing page, which that works for the browser but for GSAP doesn't work and GSAP losing the scroll position which is because of jQuery I think.
if (history.scrollRestoration) {history.scrollRestoration = "manual";} else {window.onbeforeunload = function () {window.scrollTo(0, 0);};}I'm using:GSAP 3.7.1andThanks in advance. -
I just commented out the jQuery import in index.html and that fixed. I need to know if I can use jQuery with GSAP, and how?
-
14 hours ago, OSUblake said:
What doesn't work? The demo I posted? You need to be more specific about what you mean.
I found that the issue is because I'm using jQuery!
-
On 8/25/2021 at 2:07 AM, OSUblake said:
Does this work? And make sure you're using the latest version, 3.7.1.
No that doesn't work. I'm using version 3.7.1
-
27 minutes ago, OSUblake said:
Works for me. What did you try?
Yes, works for the browser to not saving the scroll position but not for GSAP.
I used:
if (history.scrollRestoration) {history.scrollRestoration = "manual";} else {window.onbeforeunload = function () {window.scrollTo(0, 0);};} -
20 hours ago, OSUblake said:
If you want it to scroll to the top, you would have to do something like this.
https://stackoverflow.com/a/67268472/2760155
ScrollTrigger is just going to react to whatever the scroll position is.
Doesn't work.
-
46 minutes ago, OSUblake said:
Browsers save the scroll position when you reload a page. Try it without adding scroll trigger, and it should reload to its last scroll position.
That's correct but how can I solve this issue? is this possible for ScrollTrigger to read the saved scroll position?
-
Issue with GSAP and jQuery
in GSAP
Posted
Hi,
I finally fixed it, that was a bug in my code.
Thanks.
Ali