Jump to content
Search Community

Sanjero

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by Sanjero

  1. Hi, I finally fixed it, that was a bug in my code. Thanks. Ali
  2. Thank you for your reply, I will try to figure the issue out and let you know.
  3. Thank you for your reply. Don't try it on codepen, just paste the code in a HTML file, import the jquery then try.
  4. 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.1 and https://code.jquery.com/jquery-3.6.0.min.js Thanks in advance.
  5. 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?
  6. 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); }; }
  7. That's correct but how can I solve this issue? is this possible for ScrollTrigger to read the saved scroll position?
  8. Hi, My page is a simple HTML/CSS not React, Angular, etc. But I have same issue when I refresh the page. I made a new pen with the code that I used on my template, please check: https://codepen.io/Sanjero/pen/oNwvJKY
×
×
  • Create New...