-
Notifications
You must be signed in to change notification settings - Fork 89
Page transition animation? #78
Comments
Hmmm, good question. |
Actually, I didn't worked with turbolinks :) But I found example here: http://paweljaniak.co.za/2013/05/15/Rails-4-turbolinks-and-wiselinks/
Seems like this is usable also for wiselinks if would be possible to override the way wiselinks changes html of $target. I think it's somewhere here (lib / assets / javascripts / _request_manager.js.coffee:80):
|
Wiselinks have similar events |
To make the animated page transition, you can use the following code as starting point window.wiselinks = new Wiselinks($('#your-target-container'))
$(document).off('page:loading').on('page:loading', function(event) {
$('#your-target-container').hide()
// This is your starting animation
});
$(document).off('page:always').on('page:always', function(event) {
$('#your-target-container').fadeIn('normal')
// This is your ending animation
}); The above code will hide the loaded contents of the target container and then fade in the contents of the linked page. You can adjust the jQuery effects as needed for your site or applications. For even smoother transitions, you can attach CSS3 animations (via addClass() method) to your target container. |
@Appwerks what if it loads too fast ? |
what if the target container is 'body'? |
How is it possible to make page transition animation? (Just as example with turbolinks: http://www.xtagon.com/music)
To make it possible I need some way to override code that changes html in $target. Is it possible?
Thanks
The text was updated successfully, but these errors were encountered: