views:

49

answers:

1

I'm using the following Java Script Code:

function activeTr( row ) {
    row.bgColor='#F1E1D1';
    document.body.style.cursor = 'pointer';
}

function inactiveTr( row ) {
    row.bgColor='transparent';
    document.body.style.cursor = 'default';
}

Respective the following HTML:

<table>
    <tr bgcolor="transparent" class="" onclick="showFoo('1')" onmouseout="inactiveTr(this)" onmouseover="activeTr(this)">
        <td>fooburg</td>
    </tr>
</table>

Everything works fine with activeTr(), but inactiveTr() switches to a light green instead of transparent background. This issue occurs only in Opera's current version (both Windows & Mac). Firefox/Chrome/Safari behave correctly on the same plattforms.

Question: please let me know if you have ideas how to fix this.

A: 

Sometimes one has to explain the problem to find a solution. I adjusted the Java Script to the following (requires jQuery) and created a CSS class named hover:

function activeTr( row ) {
    document.body.style.cursor = 'pointer'; 
    $(row).addClass("hover");
}

function inactiveTr( row ) {
    $(row).removeClass("hover");
    document.body.style.cursor = 'default';
}

Everything works as expected now, even in Opera ;-)

MrG