リストIDに追加し、このIDまでスクロールするだけです
<div id="item_1002">content of 1002</div>
<div id="item_1003">content of 1003</div>
<div id="item_1004">
<span>content of 1004</span>
<a href="#item_1002">goto 1002</a>
</div>
これは、JavaScriptでも機能します:)
ユーザーはリンクをクリックし、投稿に移動しid
(現在のページで利用可能な場合)、のような場所を指定しhttp://site.com/#item_1002
ます。そして、ユーザーがブラウザに戻るをクリックしたら、URLをに変更しhttp://site.com/#item_1004
てスクロールします<div id="item_1004">...
編集
これはうまくいかないと確信していますが、コンセプトとしては私の悪い英語よりも優れています
<script type="text/javascript">
// scroll to id
// http://stackoverflow.com/questions/68165/javascript-to-scroll-long-page-to-div
// need to use this
// History.Adapter.bind(element,event,callback);
// but I'm stuck how it works
// so jQ
$(document).ready(function(){
$('a').click(function(){
// document.getElementById('youridhere').scrollIntoView();
$(this).scrollIntoView();
History.pushState({}, 'title', '#item_ID');
})
// Bind to StateChange Event
// Note: We are using statechange instead of popstate
History.Adapter.bind(window,'statechange',function(){
// Note: We are using History.getState() instead of event.state
var State = History.getState();
$(State.url).scrollIntoView();
});
})
</script>
<div id="item_1002">content of 1002</div>
<div id="item_1003">content of 1003</div>
<div id="item_1004">
<span>content of 1004</span>
<a href="javascript:">goto 1002</a>
</div>