为什么我不能使用jQuery在IE中淡出此表行? [英] Why can't I fade out this table row in IE using jQuery?

查看:83
本文介绍了为什么我不能使用jQuery在IE中淡出此表行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法使表行在IE中淡出.它适用于Chrome,但不适用于IE.它只是变成真正的光",并停留在屏幕上.我尝试了带有和不带有兼容模式的IE8.

I can't get the table row to fade out in IE. It works in Chrome, but not IE. It just becomes really 'light' and stays on the screen. I tried IE8 with and without compatibility mode.

<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">

function hideIt()
{
    $('#hideme').fadeTo("slow", 0.0);
}

</script>
</head>
<body>
<table>
 <tr id='hideme'>
  <td>Hide me!</td>
 </tr>
</table>
<button onclick='hideIt();'>Hide</button>
</body>
</html>

是否有解决方法/解决方案以实现平滑的淡入淡出效果?

Is there a workaround/solution for a smooth fade?

推荐答案

是的,这是IE中的错误(功能?).如果将其应用于td元素而不是tr,您将获得所需的效果.所以,

Yeah, that's a bug (feature?) in IE. If you apply it to the td elements instead of the tr, you'll get the desired effect. So,

$('#hideme>td').fadeTo("slow", 0.0);

这篇关于为什么我不能使用jQuery在IE中淡出此表行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆