Code

Page Transition Click Delay

Add a delay when a user clicks on a link on your Webflow site. This functionality adds a nice delay to your Webflow site before the users hit the next page.

Page Transition Click Delay preview

Add a delay when a user clicks on a link on your Webflow site. This functionality adds a nice delay to your Webflow site before the users hit the next page.

How to add it

  1. Add the Javascript code to your closing body tag of your page settings

The code

Javascript
                      <!-- Add to your bodys closing section -->
<!-- Page Transition Out Delay -->
<script>
$('a.class, a.class2').click(function (e) {
    e.preventDefault();                   // prevent default anchor behavior
    var goTo = this.getAttribute("href"); // store anchor href

    setTimeout(function(){
         window.location = goTo;
    },500); // time before completing action
});

</script>

                    

Browse similar code snippets

Language

More from Corey Moen

Profile →

Related Webflow questions

All answers →

Similar code snippets

All code snippets →