Keep Scroll Positions
To keep the scroll positions on a certain page during the sessoin, do the following:
1. Create a page called keepscrollpos
2. The page keepscrollpos shall contain exacltly the following lines:
[h:]
<span id="keepscrollposition1" style="display:none">
i[_pagename_]X=0;
i[_pagename_]Y=0;
if (document.cookie.indexOf('i[_pagename_]X=')>-1){
i[_pagename_]X=('; '+document.cookie).split('; i[_pagename_]X=')[1].split(';')[0];
}
if (document.cookie.indexOf('i[_pagename_]Y=')>-1){
i[_pagename_]Y=('; '+document.cookie).split('; i[_pagename_]Y=')[1].split(';')[0];
}
if(i[_pagename_]X!=''||i[_pagename_]Y!='')window.scroll(i[_pagename_]X-0,i[_pagename_]Y-0);
</span>
<span id="keepscrollposition2" style="display:none">
document.cookie='i[_pagename_]X='+escape(window.pageXOffset)+';'
document.cookie='i[_pagename_]Y='+escape(window.pageYOffset)+';'
</span>
<script>
eval(jQuery('<textarea />').html(document.getElementById('keepscrollposition1').innerHTML.replace(/!/g,'_').replace(/_=/g,'!=')).text());
jQuery(window).scroll(function() {
eval(jQuery('<textarea />').html(document.getElementById('keepscrollposition2').innerHTML.replace(/!/g,'_')).text());
});
</script>
[:h]
3. On the page which shall keep its scroll positions the last line shall be this:
[$$$:keepscrollpos]