|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Hi,
I have found this code in a php thing of mine and I would like to change it, and this bit off css is what makes it "happen". As it stands, when you mouse over a row nothing happens. What I would like it to do is change colour of the whole row (rows 1-4) (Like in phpMyAdmin browse section). This is the code I think I should change: Code:
/* Common elements */
.row1 { background-color: #F5F9FD }
.row2 { background-color: #DFE6EF }
.row3 { background-color: #EEF2F7 }
.row4 { background-color: #E4EAF2 }
I also have this bit of CSS that can change ONE row's colour, but not all of them at the same time. If it helps, this is the code. I have edited the code into the main php file I have, in all the rows, but it only changes one "cell" when you hover over it, and not the whole row. Code:
<td class="row4" onmouseover='window.status="{$info['name']}";
this.style.backgroundColor=iOver;' onmouseout='window.status="Done";
this.style.backgroundColor=iOut;' onclick="javascript:window.location.href='{$ibforums->base_url}showforum={$info['id']}';">;
</td>
</span></td>
Thanks, Prism128 PS: The iOver and iOut (in the second code) are colour references in a php file |
|
#2
|
|||
|
|||
|
It only changes the cell because the css is applied to the <td> if you apply it to the <tr> instead, it should work.
|
|
#3
|
||||
|
||||
|
k, thanks mate, will try.
Prism128 |
|
#4
|
||||
|
||||
|
i have tried it but to no avail. this is the code i put in:
Code:
function ForumRow($info) {
global $ibforums;
return <<<EOF
<tr this.style.backgroundColor=iOver;' this.style.backgroundColor=iOut;' onclick="javascript:window.location.href='{$ibforums->base_url}showforum={$info['id']}';" >
<td class="row4" align="center">{$info['img_new_post']}</td>
<td class="row4"><b><a href="{$ibforums->base_url}showforum={$info['id']}">{$info['name']}</a></b><br /><span class='desc'>{$info['description']}<br />{$info['moderator']}</span></td>
<td class="row2" align="center">{$info['topics']}</td>
<td class="row2" align="center">{$info['posts']}</td>
<td class="row2" nowrap="nowrap">{$info['last_post']}<br />{$ibforums->lang['in']}: {$info['last_unread']}{$info['last_topic']}<br />{$ibforums->lang['by']}: {$info['last_poster']}</td>
</tr>
EOF;
}
Prism128 BTW: any text with $ before it is my php language, as well as the things like: ['posts'] etc Last edited by Prism128 : February 23rd, 2004 at 02:13 PM. |
|
#5
|
||||
|
||||
|
Someone please answer!!
Prism128 |
|
#6
|
||||
|
||||
|
you were so close ...
<tr class="row4" onmouseover='window.status="{$info['name']}"; this.style.backgroundColor=iOver;' onmouseout='window.status="Done"; this.style.backgroundColor=iOut;' onclick="java_script_:window.location.href='{$ibforums->base_url}showforum={$info['id']}';">; <td> cell 1 </td> <td> cell 2 </td> </tr> INF waz raite I've done this b4, know it works, ciao |
|
#7
|
||||
|
||||
|
thanks alot mate!! il try it in 1/2 hour (when ive done some work) and let u know.
thanks again, Prism128 |
|
#8
|
|||
|
|||
|
And make sure that the css property 'background-color' is not being set on <td>'s generally at all (not even to transparent), it needs to be set to 'inherit' (which is the default if not changed).
|
|
#9
|
||||
|
||||
|
I copied the code into the right place, but it still doesn't work.
however, there was an extra semi-colon that makes an extra line appear above the table. this showed me that it was "semi-working" Here is a flash-in-a-zip file for you to see. 288KB. http://cty.hopto.org/help/forums.zip Thanks for the help so far, I feel that the end isn't far off!! Prism128 |
|
#10
|
||||
|
||||
|
; semicolon found (**red** below)
Quote:
You can also turn the cursor to a hand by using this.style.cursor='pointer' more here http://www.htmlcenter.com/tutorials...als.cfm/55/CSS/ |
|
#11
|
||||
|
||||
|
I know where the semi-colon is/was, i just left it there to show that the code "works". If i take out THAT semi-colon, nothing happens. However, I will follow the link you just gave me. Thanks.
Prism128 PS. Thanks for the pointer, I will add it when i have read the linked page!! Thanks again for your help |
|
#12
|
||||
|
||||
|
Sorry for pointing out the obvious
... i'm goofing of from work a little too much ...all the best! |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > css row colour mouseover change |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|