Sign in through GitHub

RailsCasts Pro episodes are now free!

Learn more or hide this

Nate Berkopec's Profile

GitHub User: nateberkopec

Site: http://nateberkopec.com

Comments by Nate Berkopec

Avatar

If the response comes back faster than 500ms, won't this look a little funny? Testing in this in my local environment, I've had PJAX load in the response before the div was finished fading.

My workaround for the moment is to hide immediately and then fade in, which still looks better than a simple replacement.

coffeescript
        $('[data-pjax-container]').bind("start.pjax", ->
            $('[data-pjax-container]').hide 0
        ).bind "end.pjax", ->
            $('[data-pjax-container]').fadeIn 500