Page transitions. Javascript delay + history.back?

Hi :wave:

I’m using page transitions, and was wondering if there’s a way to combine 'javascript:delay('URL') with 'javascript:history.back(); ?

I’d like to create an ‘about’ page with a back button, that plays a page transition before leaving.

Appreciate the help!

there is no such function in JavaScript.

Duplicate of

Time delay on current page before load next page
Delay link click - not working
Delay page transition for animation to complete

Hi Sam, appreciate the swift response.

Maybe I miss quoted. The delay(‘URL’) technique was taken directly from this webflow blog post. I’ve implemented it effectively across the site already.

The history.back technique was taken from a previous post of yours.

I want to know if there’s a way to combine both into a single command I can paste into the link ‘URL’ box?

I know this doesn’t work, but something like this?


Many thanks

That makes more sense now.

In that case step 1 can be changed to the following

function delayBack() {
    setTimeout( function() { history.back(1); }, 850 );

Then you’ll call via the link this way

1 Like

Great, thank you very much, works a charm!

Good, next time please cite your sources.

Hallo Sam, please, is possible to apply delay to browser back button? It is because of the same reason like Ewan wrote, but I wouldn’t want to create an extra back button. Thank you for help!