Jump to content


Photo

tr hover help in with php


  • Please log in to reply
5 replies to this topic

#1 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 17 May 2006 - 02:15 PM

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?

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 17 May 2006 - 02:19 PM

This is NOT a PHP problem, but one for Javascript and/or CSS.

Ken

#3 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 17 May 2006 - 03:06 PM

[!--quoteo(post=374655:date=May 17 2006, 10:19 AM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ May 17 2006, 10:19 AM) View Post[/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.
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#4 moberemk

moberemk
  • Members
  • PipPipPip
  • Advanced Member
  • 695 posts

Posted 17 May 2006 - 08:42 PM

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.
Disclaimer: No matter how harsh I may be, I'm always IMO only.

#5 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 17 May 2006 - 08:49 PM

[!--quoteo(post=374777:date=May 17 2006, 09:42 PM:name=moberemk)--][div class=\'quotetop\']QUOTE(moberemk @ May 17 2006, 09:42 PM) View Post[/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!

#6 moberemk

moberemk
  • Members
  • PipPipPip
  • Advanced Member
  • 695 posts

Posted 18 May 2006 - 01:14 AM

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\" /]
Disclaimer: No matter how harsh I may be, I'm always IMO only.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users