yuheijotaki.com

2013/04/07 : 
pjax

ページ遷移をスムーズに且つURL入れ替えるやつ

 

参考

 

<section id="content">
	<ul class="links">
		<li>page1</li>
		<li><a href="page2.html" class="pjax">page2</a></li>
	</ul>
	<p>loading...</p>
</section>

 

$(function(){
	$('#loading').hide();
	$(document).pjax('a.pjax', {
		container:'#content',
		fragment: '#content'
	});
	$(document).on('pjax:send', function() {
		$('#loading').show();
	})
	$(document).on('pjax:complete', function() {
		$('#loading').hide();
	})
});

 

ちゃんと使いこなせるようになりたい
デモ