Skip to content

Instantly share code, notes, and snippets.

@aggiedinger
aggiedinger / LeadPages Smooth Scroll
Last active July 6, 2022 08:26
To add a smooth scroll for anchor links
<!-- Smooth Scroll -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(document).ready(function(){
// Add smooth scrolling to all links
$("a").on('click', function(event) {
// Make sure this.hash has a value before overriding default behavior
if (this.hash !== "learn") {
// Prevent default anchor click behavior