HTML5 ローカル ストレージの使用を検討してください。まだすべてのブラウザーでサポートされているわけではありませんが、実装は非常に簡単です。
例えば:
var foo = localStorage.getItem("foo");
// ...
localStorage.setItem("content", item);
あなたの場合、その「セクション」が展開または折りたたまれるたびに、その「セクション」の localStorage のリストを更新する行を追加するだけです。
// Inside your function:
var state = // whether the 'section' is expanded or collapsed
localStorage.setItem( state, $(this).id() );
そして、ページが読み込まれると
$(section).each(function () { // 'section' should target all collapsible elements
var expanded = localStorage.getItem( $(this).id() ); // be careful here - make sure it's parsed in the correct format
if (expanded == 1) {
$(this).expand(); // your expand function
} else {
$(this).collapse(); // your collapse function
}
});
ここでそれについて読んでください