Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delay opening of page #33

Open
ghost opened this issue Nov 4, 2013 · 0 comments
Open

Delay opening of page #33

ghost opened this issue Nov 4, 2013 · 0 comments
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Nov 4, 2013

I am trying to use djax combined with css3 to animate a page load and transition. I have used the following function to add classes to all the elements I want for the transition:

function pageTransition(direction) {
direction = direction == "in" ? direction : "out";
$('div, img').each(function () {
var $item = $(this);
setTimeout(function () {
$item.addClass('slide-' + direction)
}, 80 * Math.floor((Math.random() * 5) + 1));
});
}

Then I have a css keyframe animation for the entrance and exit transition. The intro works perfect but the exit doesn't. I call the exit to run in the following way:

$(window).bind('djaxClick', function (e, data) {
// Transition content out
pageTransition('out');
});

It all works fine as in the transition works but the problem I have is the function is called, the css animation starts but the next page opens before the css animation can complete or even start. I have tried everything I can think of but I just can't get this to work.

If anyone can think of anything or point me in the right direction I would greatly appreciate it!!!

Thanks in advance!

@beezee beezee added this to the next update milestone Mar 16, 2014
@beezee beezee added the maybe label Mar 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant