Basically I am having a problem with the following: <table width="222" border="0" cellpadding="0" cellspacing="0" background="img/subbacklink.gif"> <tr> <td height="24" width="222" valign=middle> <b>Kilmurray :</b></td> </tr> <tr> <td width="222" height=3 bgcolor="#ffffff"></td> </tr> <tr> <td height="24" width="222" valign=middle onMouseOver="javascript:taust(this,'#0F363F')"onMouseOut="javascript:taust(this,'#202020')"> Basically, when the mouse moves off it no longer shows the main tables (img/subbacklink.gif) but the colour #202020. What code do I use so the background image stays visable? Obviously removing the onMouseOut will not work. Thanks, Paul.
Here is the function (i think, as I am semi-intoxicated). function taust(asi1, col1) { asi1.bgColor = col1; } Cheers.
you can use the background property and apply this like so... this.background = col1 + " url(img/subbacklink.gif)"; or change the inline call to: onMouseOut="javascript:taust(this,'#202020 url(img/subbacklink.gif)') and the function to: this.background = col1; on another note, i am not sure if it wont be better to change this via the styles collection instead...
As a complete Java plank, what should the new .js file containing the function look like? I changed a few odds and ends given what you had suggested, but so far it will only change the text colour and not highlight the table as before, which to me is saying the javascript doesn't work now. I just wished I paid more attention at advanced computer science classes instead of infiltrating the college network to spread games!
alas, no. http://reference.sitepoint.com/css/pseudoclass-hover no support that can be relied upon pre-ie7. thats still more than a quarter of my IE visitors. //change the call to add the css for background image in addition to colour. ... onMouseOut="javascript:taust(this,'#202020 url(img/subbacklink.gif)')" > var taust = function(asi1, col1) { // updated function to use the css background propertly instead of background-color. asi1.background = col1; // can specify all in 1 go, inc colour and image, background repeat and positions. }; PHP: