I finally got pjax working, but I have another question.. How do I add some jquery animation like fadeout/slideup old content and fadein/slidedown new content?
By defaul
I guess that a loading indicator and an animation are more or less the same thing. In that case, use pjax:send and pjax:complete events.
From pjax readme,
send and complete are a good pair of events to use if you are implementing a loading indicator. They'll only be triggered if an actual request is made, not if it's loaded from cache.