Ewan
(Ewan)
November 1, 2018, 5:32pm
#1
Hi
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!
samliew
(webflowexpert.com)
November 1, 2018, 10:22pm
#2
Ewan
(Ewan)
November 2, 2018, 1:28am
#3
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.
https://webflow.com/blog/how-to-build-page-transitions-in-webflow
The history.back technique was taken from a previous post of yours.
https://discourse.webflow.com/t/how-to-setup-back-button/34944
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
samliew
(webflowexpert.com)
November 2, 2018, 2:44am
#4
That makes more sense now.
In that case step 1 can be changed to the following
<script>
function delayBack() {
setTimeout( function() { history.back(1); }, 850 );
}
</script>
Then you’ll call via the link this way
`javascript:delayBack()
1 Like
Ewan
(Ewan)
November 2, 2018, 12:00pm
#5
Great, thank you very much, works a charm!
samliew
(webflowexpert.com)
November 3, 2018, 1:40am
#6
Good, next time please cite your sources.
Fradim
(Radim Blaho)
May 28, 2020, 7:13pm
#7
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!