views:

26

answers:

1

Hello

When the mouse hovers over the TR, we want to show a hidden DIV. We could bind this function to the TR with jQuery but this is just done at the server side:

<tr onmouseover="displayDIV('0123456789');" onmouseout="hideDIV('0123456789');" ...

 function displayDIV(rowID) {
    $('#options'+rowID).css('visibility','visible');
 }

 function hideDIV(rowID) {
    $('#options'+rowID).css('visibility','hidden');
 }

This is fast in Chrome, but very slow in IE. How can this be improved?

A: 

If you use

$('#options'+rowID).show()

and

$('#options'+rowID).hide()

rather than setting CSS properties directly, does the performance improve?

LarsH
Thanks for the suggestion. I've not tried this because it's not suitable - we don't want display none as content will jump about.
Igor K
Just tried it, still slow. We have a tr:hover in CSS, in IE this lags behind as each function is called, in Chrome, no lag.
Igor K
@Igor: Oh yeah. I forgot that "hide" can mean two different things... display=none vs. visibility=hidden.
LarsH