Jump to content


Photo

Highlight cell when hover over?


  • Please log in to reply
3 replies to this topic

#1 barkster

barkster
  • Members
  • PipPipPip
  • Advanced Member
  • 194 posts

Posted 24 March 2006 - 03:42 PM

Is it possible to change the background color of a cell when you hover over it? Would not contain any text in the cell. Using just CSS would be great, javascript if needed. I think I've seen it with javascript but can't figure out with CSS. Thanks

Well guess I should have googled first, pretty easy

<td bgcolor="#FFFFFF" onmouseover="style.backgroundColor='#84DFC1';" onmouseout="style.backgroundColor='#FFFFFF'">&nbsp;</td>

#2 lpxxfaintxx

lpxxfaintxx
  • Members
  • PipPipPip
  • Advanced Member
  • 181 posts

Posted 24 March 2006 - 08:37 PM

I also have a question very similiar to this. How do you create a cell where the whole row is a link, not just the text?

#3 moberemk

moberemk
  • Members
  • PipPipPip
  • Advanced Member
  • 695 posts

Posted 24 March 2006 - 08:51 PM

1st question: td:hover pseudoclass. Only works in anything but IE though.
2nd question: set the <a> tag to display as a block and use it to surround everything in the cell.
Disclaimer: No matter how harsh I may be, I'm always IMO only.

#4 Gast

Gast
  • Members
  • PipPipPip
  • Advanced Member
  • 131 posts
  • LocationSouth East England

Posted 25 March 2006 - 12:22 PM

[!--quoteo(post=358044:date=Mar 24 2006, 08:37 PM:name=lpxxfaintxx)--][div class=\'quotetop\']QUOTE(lpxxfaintxx @ Mar 24 2006, 08:37 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I also have a question very similiar to this. How do you create a cell where the whole row is a link, not just the text?
[/quote]


Or you can do:

<tr>
    <td style="background-color:#FFFFFF" onmouseover="this.style.backgroundColor='#EEEEEE'" onmouseout="this.style.backgroundColor='#FFFFFF" onclick="window.location='otherpage.php'">Text in row</td>
</tr>

OS and Internet Specs:
Windows XP (with SP2), 1680x1050, PHP 4, MySQL 3, Internet Explorer 6 &7 /FireFox 2.0/Opera 9.2

Tutorials:
Simple Introduction to AJAX and XMLHttpRequest
Creating Live Data with AJAX Making a Google Suggest like application




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users