Jump to content

tr hover help in with php


Recommended Posts

i have

while($view_array= mysql_fetch_array($view_query))

$default_amount = number_format($view_array[adverts_amount], 2, '.', ',');
$default_hits = number_format($view_array[adverts_hits]);
$default_hits_per = number_format($view_array[adverts_amount] / $view_array[adverts_hits], 2, '.', ',');
$default_unique = number_format($view_array[adverts_unique]);
$default_unique_per = number_format($view_array[adverts_amount] / $view_array[adverts_unique], 2, '.', ',');

echo" <tr>
<td width='5' height='25'>&nbsp;</td>
<td height='25'><a href='$view_array[adverts_url]' class='blue_bold_none' target='_blan'>$view_array[adverts_url]</a></td>
<td class='text'>£&nbsp;$default_amount</td>
<td class='text'>$default_hits</td>
<td class='text'>£&nbsp;&nbsp;$default_hits_per</td>
<td class='text'>$default_unique</td>
<td class='text'>£&nbsp;&nbsp;$default_unique_per</td>
echo" <tr>
<td colspan='7'><img src='$config_url/include/images/lines/blue.gif' width='100%' height='3'></td>


but how can i make the <tr></tr> section change to a light grey on hover... so you what records you are looking at?
Link to comment
Share on other sites

[!--quoteo(post=374655:date=May 17 2006, 10:19 AM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ May 17 2006, 10:19 AM) [snapback]374655[/snapback][/div][div class=\'quotemain\'][!--quotec--]
This is NOT a PHP problem, but one for Javascript and/or CSS.


right... so, to answer the original question, let's approach it from the CSS and JavaScript side: when you echo your row, you need to tell the browser how to deal with a hover. since IE doesn't support the :hover pseudo class for these elements, your best bet is to use a little of both CSS for compliant browsers and JavaScript for IE. basically, you want to create a class to attach to each row as you echo it out that you can then set a :hover color to in CSS. then, you want to create on onmouseover() and onmouseout() event in javascript that will either change the class or background-color directly to suppliment for IE.
Link to comment
Share on other sites

[!--quoteo(post=374777:date=May 17 2006, 09:42 PM:name=moberemk)--][div class=\'quotetop\']QUOTE(moberemk @ May 17 2006, 09:42 PM) [snapback]374777[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I'm still a big fan of [a href=\"http://www.xs4all.nl/~peterned/csshover.html\" target=\"_blank\"]whatever:hover[/a] myself, but Ober's method works too.
Ober? [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /] You mean obsidian right? [img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /]

Yes you can use the :hover pseudo class howewer :hover doesn't work in IE6 unless you are styling an anchor tag. But things have changed now as IE7 suports :hover on almost any html tag!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.