Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
jQuery(document).on('ready', function(event) {
// Scroll smoothly to anchor
jQuery('a[href^="#"]').on('click', function(event) {
var target = jQuery(this.getAttribute('href'));
if( target.length ) {
event.preventDefault();
jQuery('html, body').stop().animate({
scrollTop: target.offset().top
}, 1000);
}
});
});
@Nikschavan

This comment has been minimized.

Copy link
Owner Author

Nikschavan commented Apr 4, 2018

Here is a doc which explains how custom JS can be added to your site - https://wpastra.com/docs/add-custom-javascript-code-astra/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.