PJAX全局无刷新的设置方法~

先添加必要文件:

然后下面加上:

 

参考css代码(可自己去百度搜索,本站也有)

.pjax_loading {position: fixed;top: 45%;left: 45%;display: none;z-index: 999999;width: 124px;height: 124px;background: url('images/pjax_loading.gif') 50% 50% no-repeat;}

.pjax_loading1 {position: fixed;top: 0;left: 0;z-index: 999999;display: none;width: 100%;height: 100%;opacity: .2}

1.前面引用的jquery.pjax.min.js是国外大神写的jquery开源的pjax通用封装插件。

2.网上很多以上封装的教程都没有加上form事件,所以这个教程主要是解决博客的搜索和评论问题。

3.开源Pjax使用这个:https://github.com/defunkt/jquery-pjax

转载于:https://www.cnblogs.com/telwanggs/p/7136729.html

你可能感兴趣的:(PJAX全局无刷新的设置方法~)