Reply
pagination working, but how to change the colors of the active links ?
Old 09-26-2007, 09:50 PM pagination working, but how to change the colors of the active links ?
mihai074's Avatar
Experienced Talker

Posts: 36
Greetings everybody,

alot of hours have passed since i have been trying to make this work so i come here asking for help...

i managed to make a so called pagination system , the script gathers data from a mysql database and displays them on the page and makes pagination links ( page: 1 2 3 and so on depending how many pages are needed to display the requiered data)

what i have been trying to do this whole day is that when page 2, for example, is clicked, the color would change .

to be more specific here is the code:

PHP Code:

//gathering the requierd data from the database

$count mysql_query("SELECT COUNT(*) FROM games WHERE             game_type=$gt");
$nog mysql_fetch_row($count);
$x=$nog[0]/16;

//starting a div and a table

echo "<div id='page' align='center'>";
echo 
"<table border='1' class='nr' >";        
echo 
"<td class='nrp'>Page:&nbsp;&nbsp;</td>";

//the links generator

$n=1;
for (
$i=1$i<= ceil($x); $i++) {
if (
$i 1$n=$n+16;

echo 
"<td id='navigationDiv' width='10px' height='10px'><a onclick='highlightLinks(this)' class='' href='showallt.php?offset=$n&order=game_type&game_type=$gt' >";
echo 
$i;


echo 
"</a></td>";

//and the rest of the code from here down wich is not important 
i have tryied to make a background varable for the <td> in the loop with all sorts of code, but whell... my idees did not work and i did not find much on google regarding the actual color on the links when creating pagination

you would observe in the loop near <a there is a onclick fuction, thats an idee i got from google when trying to find an answer, i tryed to change the css class of the <td> and the <a> when the link was clicked, using javascript ... but it did not work because the page reloads or a new page loads so the css class goes back to the inital value , i think... anyway using javascript i think it would be a good option i guess but im quite n00b at javascripting



i am still young in the arts of programing.... pls point me in the right direction with this

Last edited by mihai074 : 09-26-2007 at 09:54 PM.
mihai074 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Reply     « Reply to pagination working, but how to change the colors of the active links ?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12958 seconds with 13 queries