Closed jorditost closed 12 years ago
This seems more like a question for the main PJAX repo. :)
That said, there are some hooks you can use:
pjax:success
is fired when the request succeeds, so you could do something like this:
jQuery('#your-container').on('pjax:success', function() {
// do fade in/out
});
Thanks for the reply! I'll ask them too ;)
In order to use it with PJAXY, should I modify some core code?
No. I would just dequeue the main pjaxy JS and enqueing your own to handle all this stuff (including binding PJAX to links, etc):
<?php
add_action('wp_enqueue_scripts', 'fix_pjaxy_scripts', 20);
function fix_pjaxy_scripts()
{
wp_dequeue_script('pjaxy-core');
// enqueue your own script here
}
Take a look at this file to see what the library does: https://github.com/chrisguitarguy/pjaxy/blob/master/js/pjaxy.js
Hi Chris, it worked for me, thanks! ;)
Hi!
I'm trying to implement PJAX / PJAXY into a Wordpress Theme.
The thing ist that i want to animate the transitions between the last page showed and the new one (Parallax-style effect) and I need to handle the 'success' callback so as the old content isn't directly replaced with the new:
For example, if a PJAX call is equivalent to:
I need to do something like (supposing now I'm fading the old content and the new one to simplify things)
Thanks for your time and help!