There is a main page, it displays 5 entries, and below there are switches to other pages where the other 5 entries will be displayed. These switches in the form of buttons 114 pieces. They are generated by the code:
for ($x=1;$x<=($num_rows)/5+1;$x++) echo "<div id='foot'><a href='?page=".$x."' class='col' style='text-decoration:none;color:black'>".$x."</a></div>"
Where $ x is the current page number.
It is necessary that when you click on a div with a link to a page, the color of the div will change while I'm on it.
I do it like this:
<script> $(document).ready(function () { $('a.col').click(function () { $(this).parent().css('background-color','darkmagenta'); $(this).css('color','red'); }) }) </script>
Everything seems to be nothing, but the color changes only for a split second, and then returns back to its original state. Here is the CSS file:
* {margin:0; padding:0} div { font-family: Calibri; } h1 { font-family: Arial,sans-serif; border-bottom-style: dotted; border-bottom-width: thin; margin-top: 15px; margin-left:15px; margin-bottom: 15px; } body { height: 100%; } #content { height: 100%; clear: both; padding-left: 15px; padding-right: 15px; } #footer { width:98%; height:150px; left:0; bottom:0; margin:0; position:fixed; background-color:white; padding-left: 20px; padding-right:15px; } #page {border-top-style: dotted; border-top-width: thin; font-family: Arial,sans-serif; font-size: 18px; margin-top: 10px; padding-top: 5px; margin-bottom: 5px; } .announce { font-size:17px; } #foot { background-color:#dfe7ff; border-style: solid; border-color:grey; border-width: thin; display: inline-block; position: relative; text-align: center; font-family: "Calibri Light"; font-size: 15px; width:35px; height:17px; margin-right: 5px; margin-bottom:5px; } #foot:hover { background-color: darkmagenta; color: white; } span.date { background-color: darkmagenta; color: white; font-family:Calibri; margin:3px 8px 0 0; } .title { font-size: 20px; } .col { display: block; }
active
orselected
, which is set from php - Grundy