|
Post by Wormopolis on Aug 28, 2010 13:29:43 GMT -8
browser tested: IE and FF placement: global footer
changes the "jump to page" area by putting more numbers out and optionally hiding the jump box.
code
<script type="text/javascript"> <!-- // pagination remod v1.2 // by Wormopolis - [url]www.wormocodes.com[/url] // do not repost - keep header intact
var minLeftsideNums=3; var minRightsideNums=3; var currentPageColor="00FF00"; var otherPageColor="FF0000"; var includeJumpBox=false;
for (imps=document.getElementsByTagName('input'), w=imps.length-1; w>=0; w--) { if (imps[w].id.match(/pageNo/)) { nwThing=imps[w].parentNode; if (!includeJumpBox) { imps[w].previousSibling.nodeValue=imps[w].previousSibling.nodeValue=''; imps[w].nextSibling.nextSibling.style.display=imps[w].style.display='none'; } nwThing.getElementsByTagName('span')[0].onmouseover=''; lnktmp=nwThing.getElementsByTagName('span')[0].getElementsByTagName('a')[0]; pre='<a style="color:#'+otherPageColor+'" href="'+lnktmp.href.split('&page=')[0]+'&page='; curPage=(nwThing.getElementsByTagName('span')[0].innerHTML.match(/page (\d+)/i) ? parseInt(RegExp.$1) : 1); lastPage=parseInt(lnktmp.innerHTML); nwStuff="Page: "; if (lastPage<=minLeftsideNums) { for (a=1; a<=lastPage; a++) nwStuff+=(a==curPage ? '<b style="color:#'+currentPageColor+'">'+a+'</b> ' : pre+a+'">'+a+'</a> '); } else { for (a=1; a<=minLeftsideNums; a++) nwStuff+=(a==curPage ? '<b style="color:#'+currentPageColor+'">'+a+'</b> ' : pre+a+'">'+a+'</a> '); if (lastPage<=(minLeftsideNums+minRightsideNums)) { for (a=minLeftsideNums+1; a<=lastPage; a++) nwStuff+=(a==curPage ? '<b style="color:#'+currentPageColor+'">'+a+'</b> ' : pre+a+'">'+a+'</a> '); } else { if ((curPage-2)>minLeftsideNums) nwStuff+="... "; if ((curPage-1)>minLeftsideNums && (curPage-1)<=(lastPage-minRightsideNums)) nwStuff+=pre+(curPage-1)+'">'+(curPage-1)+'</a> '; if (curPage>minLeftsideNums && curPage<=(lastPage-minRightsideNums)) nwStuff+='<b style="color:#'+currentPageColor+'">'+curPage+'</b> '; if ((curPage+1)>minLeftsideNums && (curPage+1)<=(lastPage-minRightsideNums)) nwStuff+=pre+(curPage+1)+'">'+(curPage+1)+'</a> '; if ((curPage+2)<=(lastPage-minRightsideNums)) nwStuff+="... ";
for (a=(lastPage-minRightsideNums+1); a<=lastPage; a++) nwStuff+=(a==curPage ? '<b style="color:#'+currentPageColor+'">'+a+'</b> ' : pre+a+'">'+a+'</a> '); } } nwThing.getElementsByTagName('span')[0].innerHTML=nwStuff; } }
// --> </script>
preview: using it on this site;
|
|
wildgoosespeeder
Code Helper
Tiers are for strangers!
Posts: 530
wildgoosespeeder said 161 great things
|
Post by wildgoosespeeder on Oct 26, 2010 17:15:53 GMT -8
I noticed something weird about page numbers on this site and then I found this code. That explains the strange behavior and look of page numbers on this site. Anyways I really like this code because I hate that page jump box that appears. The only thing I don't like about it is the color override for hyperlinks to other page numbers. I just removed every occurrence of the variables "currentPageColor" and "otherPageColor" so that way depending on my skin settings, the colors for the hyperlinks will take on the color settings of the skin. Otherwise I really like this code! Thanks Wormo for creating it! ;D
|
|
|
Post by Wormopolis on Oct 26, 2010 19:31:17 GMT -8
color overrides were part of the original request for the code so I left em in. Sometimes the default skin colors are hard to see with whatever background is in the titlebg cell.
so yeah.. either remove em or use some selector to change them per skin setting I guess.
yer welcome.
|
|
riccetts
Not New Member
Prayer is gooood!
Posts: 44
riccetts said 0 great things
|
Post by riccetts on Oct 25, 2012 14:04:02 GMT -8
Hey Wormo How can I resize the numbers? They seem somewhat small.
|
|
|
Post by Wormopolis on Oct 26, 2012 0:59:57 GMT -8
in all the places where you see
<b style="color:#'+
change it to
<b style="font-size:18px; color:#'+
|
|
riccetts
Not New Member
Prayer is gooood!
Posts: 44
riccetts said 0 great things
|
Post by riccetts on Oct 27, 2012 9:35:03 GMT -8
Thanks man
|
|