Skip to content

Instantly share code, notes, and snippets.

@faisalahammad
Last active February 13, 2024 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save faisalahammad/b77b3ab7fcf308412c7348551ee8348d to your computer and use it in GitHub Desktop.
Save faisalahammad/b77b3ab7fcf308412c7348551ee8348d to your computer and use it in GitHub Desktop.
<script>
jQuery(document).ready(function($) {
setTimeout(function() {
$('.et_pb_gallery_pagination a').click(function(event) {
event.preventDefault();
$('html, body').animate({
scrollTop: 0
}, 'smooth');
});
}, 1000);
});
</script>
<script>
document.querySelectorAll('.et_pb_gallery_pagination a').forEach(link => {
link.addEventListener('click', function(event) {
event.preventDefault();
// Scroll to the top of the page
window.scrollTo({ top: 0, behavior: 'smooth' });
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment