Yep, you're literally plugging in the code referenced in the other thread to this one, which wouldn't work. For example, you wouldn't be calling gallery.expandit(externalselectindex) as you did above, which is for Tab Content script.
Starting from scratch, here's what you would do:
1) Insert the below function to the very end of virtualpaginate.js:
Code:
function externalselectlisten(tabcontentvar){
var re=new RegExp(tabcontentvar+"=(\\d+)", "i") //match tabcontentvar=xxx (xxx=integer)
var urlparam=window.location.href.match(re)
var paramvalue=RegExp.$1
if (/\d+/i.test(paramvalue)) //if URL parameter contains "?tabcontentvar=xxx"
return parseInt(paramvalue) //return xxx part
else
return -1
}
2) Then, at the end of your initialization code within your HTML page, add the part in red to it. For example:
Code:
<!-- Initialize Demo 2 -->
<script type="text/javascript">
var newscripts=new virtualpaginate("virtualpage2", 1, "p") //Let script know you're using "p" tags as separator (instead of default "div")
newscripts.buildpagination("scriptspaginate")
var externalselectindex=externalselectlisten("vp")
if (externalselectindex!=-1)
newscripts.showpage(externalselectindex) //show page per url parameter (?vp=externalselectindex)
</script>
Now this particular virtual pagination instance will respond to something like:
Code:
http://www.satorimedia.co.uk/samplekart.htm?vp=2
Where loading the URL with "vp=2" causes the 3rd slide to be shown by default. 0=1st slide etc.
Bookmarks