Cell Rollover Colours
Hi,
Please can someone help me with telling me how i can have a cell with a hyperlink in it where when you rollover the cell, the box changes colour?
Thanks
Hi,
Please can someone help me with telling me how i can have a cell with a hyperlink in it where when you rollover the cell, the box changes colour?
Thanks
Megan posted this at 14:33 — 9th February 2006.
She has: 11,421 posts
Joined: Jun 1999
I've done this with lists but not with tables so I'm not sure how well this technique would work on a table. Basically, what you do is increase the padding on your a tag so it fills the spcae you want. The table or list itself would have no padding. Then change the background colour on hover.
Check my personal site for an example using a list.
Megan
Connect with us on Facebook!
robfenn posted this at 15:08 — 9th February 2006.
He has: 471 posts
Joined: Jun 2005
I have done it here:
http://www.sixthsense-esp.co.uk/horsted/index.htm
TimMorgan posted this at 16:05 — 9th February 2006.
They have: 14 posts
Joined: Feb 2006
Yeah thats the one robfenn.
How did you do that then?
robfenn posted this at 16:35 — 9th February 2006.
He has: 471 posts
Joined: Jun 2005
Well in truth, i just took it from a Javascript website.
Code for header:
<script language="javascript"type="text/javascript">
/*
Change Cell Backgrounds -
© Shivaji Basu (shivbasu.com)
To add more shock to your site, visit DHTML Shock.com
*/
function cOn(td){
if(document.getElementById||(document.all && !(document.getElementById))){
td.style.backgroundColor="#588EC0";
}
}
function cOut(td){
if(document.getElementById||(document.all && !(document.getElementById))){
td.style.backgroundColor="#FFFFFF";
}
}
</script>
Example Table:
+ Virtual Tour
DaveyBoy posted this at 17:51 — 9th February 2006.
They have: 453 posts
Joined: Feb 2003
I don't think you need a java script for it :
TimMorgan posted this at 18:00 — 9th February 2006.
They have: 14 posts
Joined: Feb 2006
Yeah that does the job, nice one cheers DaveyBoy.
dk01 posted this at 19:28 — 9th February 2006.
He has: 516 posts
Joined: Mar 2002
That is javascript actually. Its just embedded instead of being put in a script tag. Good solution but it won't show up if JS is turned off.
robfenn posted this at 19:31 — 9th February 2006.
He has: 471 posts
Joined: Jun 2005
But then no one turns Javascript off...
DaveyBoy posted this at 19:48 — 9th February 2006.
They have: 453 posts
Joined: Feb 2003
Yeah just saying you don't need the big script at the top of the page
A few people do turn javascript off but well not enough to worry about i'd say.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.