Jump to content

Archived

This topic is now archived and is closed to further replies.

brown2005

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>
</tr>";
echo" <tr>
<td colspan='7'><img src='$config_url/include/images/lines/blue.gif' width='100%' height='3'></td>
</tr>";

}

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

Share this post


Link to post
Share on other sites
This is NOT a PHP problem, but one for Javascript and/or CSS.

Ken

Share this post


Link to post
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.

Ken
[/quote]

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.

Share this post


Link to post
Share on other sites
I'm still a big fan of [a href=\"http://www.xs4all.nl/~peterned/csshover.html\" target=\"_blank\"]whatever:hover[/a] myself, but Obsidian's method works too.

Share this post


Link to post
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.
[/quote]
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!

Share this post


Link to post
Share on other sites
Um... yes, of course I did. I definitely didn't edit my post to not make me look stupid... [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /]

Share this post


Link to post
Share on other sites

×

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.