Rollover script med billede
Hej,Jeg har denne tabel:
<table width="858" height="310" border="0" cellpadding="0" cellspacing="0" background="image1.jpg"><tr>
<td width="309" onClick="document.location.href='soening.html'" onMouseOver="cellChange(this,1);" onMouseOut="cellChange(this,2);"> </td><td width="264"></td><td width="285"> </td></tr>
</table>
Og dette script:
function cellChange(cell,value)
{
if (value==1)
{
cell.style.cssText = 'background-color: #BEBEBE; color: #BEBEBE';
}
if (value==2)
{
cell.style.cssText = 'background-color: #; color: #';
}
}
På mouseover skifter den farven i cellen, men hvordan får jeg den til at skifte et billede i stedet? Altså en erstatning af cell.style.cssText = 'background-color: #BEBEBE; color: #BEBEBE';
med noget a la dette: cell.style.cssText = 'background-image: image3.jpg';
Det virker dog ikke helt...
