Use the:
Code:
instance.showpage(page_number)
as documented on:
http://www.dynamicdrive.com/dynamici...nation_ref.htm
in conjunction with this javascript 'get' function:
Code:
<script type="text/javascript">
function getQval(n, m) {
/*my n=name, m=searchString(optional)*/
if(!arguments[0]||typeof n!='string')
return null;
var r=new RegExp('[?&;]'+n+'=([^&;#]*)'), m=arguments[1]?m:location.search;
return (m=r.exec(m))? unescape(m[1]) : null;
}
</script>
So, you would have something like (on another page):
Code:
<a href="some_page.htm?page=3">Goto Virtual Pagination Page, page 4</a>
Then on the virtual pagination page (some_page.htm in this example), have:
Code:
<script type="text/javascript">
function getQval(n, m) {
/*my n=name, m=searchString(optional)*/
if(!arguments[0]||typeof n!='string')
return null;
var r=new RegExp('[?&;]'+n+'=([^&;#]*)'), m=arguments[1]?m:location.search;
return (m=r.exec(m))? unescape(m[1]) : null;
}
if(getQval('page'))
instance.showpage(getQval('page')*1)
</script>
Just put it after the initialization of the virtual page. Also, the instance would need to be the name of the variable used to initialize the virtual content in the first place.
Like, if using the first demo content:
Code:
<!-- Initialize Demo 1 -->
<script type="text/javascript">
var gallery=new virtualpaginate("virtualpage", 1)
gallery.buildpagination("gallerypaginate")
</script>
<script type="text/javascript">
function getQval(n, m) {
/*my n=name, m=searchString(optional)*/
if(!arguments[0]||typeof n!='string')
return null;
var r=new RegExp('[?&;]'+n+'=([^&;#]*)'), m=arguments[1]?m:location.search;
return (m=r.exec(m))? unescape(m[1]) : null;
}
if(getQval('page'))
gallery.showpage(getQval('page')*1)
</script>
Remember, numbering in javascript usually begins with 0. In this case that means that page 1 is 0, page 2 is 1, etc. So to get page 3 you would use:
Code:
<a href="some_page.htm?page=2">Goto Virtual Pagination Page, page 3</a>
Bookmarks