I\'m trying to build an effect like this for smoothstate: http://tympanus.net/Development/PageTransitions/, specifically the \"room\" transitions.
I\'m getting stuck
Hope you still need it. That's how I implemented this:
$(function () {
//'use strict';
var $page = $('.m-scene'),
options = {
debug: true,
onStart: {
duration: 0,
render: function ($container) {
$('.m-page.temp').remove(); //make sure we don't have more than two `pages` at a time
$('#move').removeClass('slideup'); //remove old animation; #move is the wrapper for original and injected content
$container.find('.m-page').addClass('temp'); //mark original content for removal
}
},
onReady: {
duration: 50, //prevents flickering of content
render: function ($container, $newContent) {
$('#move').append($newContent.find('.m-page')); //select only stuff you actually need injected
}
},
onAfter: function ($container, $newContent) {
var target = $('#move');
animate(target); //it's animation time!
}
},
smoothState = $page.smoothState(options).data('smoothState');
});
function animate(target) {
target.addClass('slideup'); //add animation class
}