Demo:
http://home.comcast.net/~jscheuer1/s...e/v_page_c.htm
I did this for one virtual pagination on a page. It could be worked out for as many as needed. No change was made to the virtualpaginate.js file. All additions were made in the body initialization script. Use your browser's "view source" to see the code.
Notes: If using this for more than one instance of virtual pagination on the page, you only need to add these functions once:
Code:
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
Each instance would need its own:
Code:
if(readCookie('gallery_page')){
if(gallery.flatviewpresent)
gallery.flatviewlinks[gallery.currentpage].className=""
gallery.currentpage=readCookie('gallery_page')*1;
gallery.navigate(readCookie('gallery_page')*1);
}
following its initialization, with the word gallery changed to the variable name for that instance. It would also need to be added to the onunload event:
Code:
onunload=function(){
createCookie('gallery_page',gallery.currentpage,0)
}
by giving it its own createCookie line in that function and once again changing the word gallery to its variable name.
Bookmarks