View Full Version : Java.... I think!
Abyss Network
06-11-2001, 11:30 AM
Can someone tell me how I can make a cell of a table's background change color?
[Edited by Abyss Network on 06-11-2001 at 01:33 PM]
avg-joe
06-11-2001, 12:26 PM
Try this code...
<blockquote><html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function colorChange(obj, changeColor) { //v.1 Joe Bartlett, Avg-Joe.Com
obj.style.backgroundColor=changeColor
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table border="1" width="555" bordercolor="#000000">
<tr>
<td onMouseOver="colorChange(this, '#0033FF')" onMouseOut="colorChange(this,
'')">&nbsp;</td>
</tr>
<tr>
<td onMouseOver="colorChange(this, '#990099')" onMouseOut="colorChange(this,
'')">&nbsp;</td>
</tr>
</table>
</body>
</html></blockquote>
That should work for you. You can also apply this to onMouseDown and onMouseMove functions!
Hope that helps!
Abyss Network
06-11-2001, 05:12 PM
Thank you sooooooo much!!!!!
Abyss Network
06-11-2001, 05:30 PM
What are the other add-ons usefull for... i.e. what do they do?
Abyss Network
06-11-2001, 05:53 PM
Is there any way I can also make the text change when it lands over the table cell. Even if it's not on the actual text...?
Like... I move my mouse over a text-less area in the cell, and the background changes to #99CCFF and the text changes to #202060?
Thanks!
avg-joe
06-12-2001, 12:23 AM
Honestly, I'm not absolutely sure this would be an easy effect to accomplish since you would need be able to "link" the text effect to the actual area of the table cell itself. Everything I tried required the mouse to roll over the text itself.
I'll continue to look into it though...
If you have a halfway decent graphics editor, you may want to try a simple rollover technique using .gifs or .jpgs to create the desired effect.
I used kind of the same technique while creating a splash page for one of my favorite bands. They passed on it but I still liked the test page enough to put it in my portfolio. I used both layers and rollovers... Check it out.. http://www.avg-joe.com/services/portfolio/kx/index.htm
Too much info? Probably... :)
avg-joe
06-12-2001, 12:38 AM
Oh, and as for the other commands I spoke of...
<b>onMouseDown</B> - changes background when clicked
<b>onMouseMove</b> - changes background when the mouse passes through the table cell, then reverts back once the mouse has left the field. (on afterthought, I think I would use this instead of the onMouseOver/onMouseOut code I gave you earlier. It does the same thing with half the coding...
You could also try <b>onMouseUp</b>, which changes the color not on mouse click, but on release. There are probably quite a few other javascript commands to create any number of interesting effects...
[Edited by avg-joe on 06-12-2001 at 12:32 PM]
Abyss Network
06-12-2001, 09:56 AM
Thank you! You have been a lot of help! I am more of an HTML programmer... havn't had much time to learn anything else! Ha Ha... I have been working with HTML for over 5 years.... nothing more tho!
Learn Perl and ASP or VB and C++ - maybe we can team up and develope some really popular program!
Haha!
Abyss Network
06-21-2001, 03:43 PM
Tell me USEFUL websites, not like the ones you gave me, and maybe we can!
go to amazon.com and buy some books on it!
msdn.microsoft.com - VB 6.0 and C++ 6.0
www.perl.com
Abyss Network
06-21-2001, 03:52 PM
You told me not to buy books you fruit!
why would you want to change table colors?
oh yeah, well books are good for referencing.. You should learn it for free by paying me (hehe)
vBulletin® v3.6.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.