Pjax动画动画、Pjax

由网友(只是当时年少.)分享简介:我终于pjax的工作,但我有一个问题..我如何添加一些jQuery的动画一样淡出/效果基本show旧的内容和淡入/了slideDown新的内容?I finally got pjax working, but I have another question.. How do I add some jquery anim...

我终于pjax的工作,但我有一个问题..我如何添加一些jQuery的动画一样淡出/效果基本show旧的内容和淡入/了slideDown新的内容?

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?

在默认情况下pjax只是改变没有任何好看的效果的内容。

By default pjax just changes the content without any good looking effects..

任何帮助将是非常美联社preciated。

Any help would be much appreciated.

最好的问候

推荐答案

基本上,你有一串事件锁存到,做你喜欢。下面是一个使用基本淡入淡出版本pjax:启动 pjax:年底为触发器

Basically, you have a bunch of events to latch on to and do as you like. Here's a basic fadeIn and fadeOut version using the pjax:start and pjax:end as triggers.

$(document)
  .on('pjax:start', function() { $('#main').fadeOut(200); })
  .on('pjax:end',   function() { $('#main').fadeIn(200); })

显然,你会换 #main 为你换进出内容的容器元素。

Obviously you would swap #main for the container element you're swapping content in and out of.

阅读全文

相关推荐

最新文章