Archived topic
Newbie Question: Working free of JQuery
4 replies · Started by Steve on July 16, 2022
I learned that adding the sticky menu loads JQuery and I want to avoid that.
I'm new to Generate Press. I've used Genesis platform child themes for years and years and can't get free of JQuery there.
Will the sticky nav ever be free of JQuery?
and a related question
Is there a way to add classes to divs on scroll without JQuery? Kadence does this I see. My JS skills are minimal and would like to do this with Vanilla JS or React... mainly trying to maintain site speed and avoid JQuery.
Hi there,
we are planning to add a jQuery free sticky nav option, albeit it may be without transitions which is the only reason we haven't change that today.
Adding class attributes to element on scroll, you may want to check out the IntersectionObserver API. It can be run using vanilla JS:
https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API
And heres one of many tutorials on using it:
https://www.hweaver.com/intersection-observer-single-page-navigation/
Thank you for this very interesting and engaging reply. That's a huge plus for Generate Press. It seems I should wait to see the direction Generate Press takes as there are many considerations. One consideration is all the transition in place at the moment and patience needed to see how things unfold. I appreciate your thoughtful reply.
Thanks again. Closing ticket.
You're welcome