I have addon to this script it would be good to add it as a varible but i don't know how yet so I hard coded it.
Code:
virtualpaginate.prototype.paginate_build_regularlinks=function(paginatelinks){
var instanceOfBox=this
for (var i=0; i<paginatelinks.length; i++){
var currentpagerel=paginatelinks[i].getAttribute("rel")
if (/^(previous)|(next)|(first)|(last)$/.test(currentpagerel)){ //screen for these "rel" values
paginatelinks[i].onclick=function(){
if (this.currentpage != 0){
window.location = "#top"}
instanceOfBox.navigate(this.getAttribute("rel"))
return false
}
}
if (currentpagerel=="previous" || paginatelinks[i].href.indexOf("previous")!=-1){ //check if this is a "previous" link
if (!this.wraparound && this.currentpage==0) //if current page is first page, disable "prev" link
virtualpaginate.setcssclass(paginatelinks[i], "disabled", "add")
this.prevlinks.push(paginatelinks[i])
}
else if (currentpagerel=="next" || paginatelinks[i].href.indexOf("next")!=-1){ //check if this is a "next" link
if (!this.wraparound && this.currentpage==this.pagecount-1) //if current page is last page, disable "next" link
virtualpaginate.setcssclass(paginatelinks[i], "disabled", "add")
this.nextlinks.push(paginatelinks[i])
}
}
}
if (this.currentpage != 0){window.location = "#top"}
this is the line it jumps to a html anchor when clicked next but not on the first page.
Bookmarks