Archived topic
Scroll effect
3 replies · Started by Leonardo on October 5, 2022
Hello guys!
How do I add an effect to a certain element/block in which as you scroll down the page with the mouse, the element/block goes up?
This is achieved very easily with Elementor, more precisely in scroll effects.
Hi Leonardo,
You would need custom code or a third party plugin for this.
Specifically, for custom code, you would need Javascript which is out of our scope of support. It would be best to reach out to a developer or ask for recommendations in our Facebook Group: https://www.facebook.com/groups/1113359788719597
Here's a codepen code I found however which may help you: https://codepen.io/kostastepetes/pen/jOVxXYg
Fernando, let's say I can develop this code in JS.
How would I "inject" it into WordPress? Would I have to develop a plugin for that too?
I ask because I'm starting my studies in Frontend and, from what I could see on the website you sent me, it doesn't seem that difficult...
Hi there,
if you're studying frontend development then i would suggest you develop a plugin for that.
As a general rule and script libraries you want to install you would use wp_enqueue_script
https://developer.wordpress.org/reference/functions/wp_enqueue_script/
And for the inline scripts, you can Hook them in using the wp_footer hook. This will ensure the script is fired after the HTML is loaded.