How can I animate the page:change with turbolinks?
Is that possible?
I tried a css transition on body but it did not work as expected. Don't know how to update just one part of the window and made a callback when it's done, or if it is even possible.
Thanks in advance
Something like this might work (in CoffeeScript using jQuery):
$(document).on 'page:fetch', ->
$('#content').fadeOut 'slow'
$(document).on 'page:restore', ->
$('#content').fadeIn 'slow'
You could also use CSS animations or some more complicated JavaScript. Here's a great post that goes in-depth with some examples and demos.
Also, I came across a turbolink transitions ruby gem (which I have not tested).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With