Aleš Sýkora / September 14, 2021 / 0 comments
How to set scroll to the top with jQuery on click button
1 min read / Custom Code, WordPress / Share on: Twitter, LinkedIn, Facebook
Post summary: Create a button and set an ID to it. Then change the #submitButton in code below to your button ID and save. In Oxygen Builder, you can use a code block for this Javascript.
Create a button and set an ID to it. Then change the #submitButton in code below to your button ID and save. In Oxygen Builder, you can use a code block for this Javascript.
jQuery(document).ready(function() {
jQuery('#submitButton').click(function() {
jQuery(window).scrollTop(0);
});
});
Fuel my passion for writing with a beer🍺
Your support not only makes me drunk but also greatly motivates me to continue creating content that helps. Cheers to more discoveries and shared success. 🍻