开发者

jQuery Slow in IE to do a mouseover on a TR

开发者 https://www.devze.com 2023-01-15 12:24 出处:网络
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:

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');
 }

Thi开发者_如何学运维s is fast in Chrome, but very slow in IE. How can this be improved?


If you use

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

and

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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号