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: </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.
|