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

查看:14
本文介绍了为什么我不能使用 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天全站免登陆