如何通过pjax进行github样式页面转换 [英] How to make github style page transitions by pjax

查看:207
本文介绍了如何通过pjax进行github样式页面转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一次,我读了一篇文章说github页面转换是由pjax完成的,我检查了 jquery- pjax 项目。我想我已接近答案,它必须与事件 pjax相关:启动 pjax:结束,但我仍然无法得到它,所以我试着在这里得到一些帮助。

Once a time, I read an article said that github page transition is made by pjax, I checked jquery-pjax project. I think I have close to the answer, it must be something related with event pjax:start and pjax:end, but I still can't get it works, so I try to get some help here.

$('a.pjax').pjax('#main');
$('#main').bind('pjax:start', function(){$('#main').slideUp()})
  .bind('pjax:end'), function(){$('#main').slideDown()});

但它没有效果

推荐答案

Github使用HTML5功能进行页面转换。这包括新的JS History API和CSS3过渡。除标准事件监听,选择器外,没有涉及jQuery。博客文章在这里提供了所有相关链接
https://github.com / blog / 760-the-tree-slider

Github use HTML5 features for the page transitions. That includes the new JS History API and CSS3 transitions. No jQuery involved except for standard event listening, selectors. The blog post is here with all the relevant links https://github.com/blog/760-the-tree-slider

这篇关于如何通过pjax进行github样式页面转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆