PDA

View Full Version : Link names in Virtual Pagination



ricmetal
03-10-2009, 01:59 AM
1) Script Title: Virtual Pagination script v2.0

2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...pagination.htm

3) Describe problem: No problem

Would like to have the script tweaked, so when using class=flatview, it shows the names of each page on the href, when i hover each link.

like gmail (each section shows #inbox, #stared, etc).

if i could get some help on this, would be great!

or some pointers so i can do it myself..

either way helps appretiated

thanks

ddadmin
03-10-2009, 08:34 AM
Try finding the below code inside the .js file:


for (var i=0; i<this.pagecount; i++){
if (typeof anchortext[i]!="undefined") //if custom anchor text for this link exists
flatviewhtml+='<a href="#flatview" rel="'+i+'">'+anchortext[i]+'</a> ' //build pagination link using custom anchor text
else
flatviewhtml+='<a href="#flatview" rel="'+i+'">'+(i+1)+'</a> ' //build pagination link using auto incremented sequential number instead
}

And replace it with:


var anchortext=anchortext || new Array()
for (var i=0; i<this.pagecount; i++){
if (typeof anchortext[i]!="undefined") //if custom anchor text for this link exists
flatviewhtml+='<a href="#'+anchortext[i]+'" rel="'+i+'">'+anchortext[i]+'</a> ' //build pagination link using custom anchor text
else
flatviewhtml+='<a href="#page'+(i+1)+'" rel="'+i+'">'+(i+1)+'</a> ' //build pagination link using auto incremented sequential number instead
}

ricmetal
03-10-2009, 04:47 PM
looks cool :)
althought, id like to display small letters on the link while leaving capital letters on the pagination buttons.
but ill take it from here and try to tweak some more!
thanks ddadmin