最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How can I fade-out a row (TR) in IE6 or 7 - Stack Overflow

programmeradmin0浏览0评论

I'm using JQuery to fade-out rows (TR) when the user clicks a Delete button on a row (TR). By fade-out, I mean the entire row (TR) background-color is changed to an off red and then it fades to white and disappears. This is a great little animation for showing the user an instant reaction for what the did.

The JavaScript looks like this:

$(tr).css("background-color", "rgb(255,200,200)");
$(tr).fadeOut(500, RemoveDomElement);

This works beautifully in Firefox, Safari, Opera and Chrome, but - of course - not in IE. IE will execute the code and finish the cleanup, but the actual fade-out animation isn't shown.

What can I do for IE?

I'm using JQuery to fade-out rows (TR) when the user clicks a Delete button on a row (TR). By fade-out, I mean the entire row (TR) background-color is changed to an off red and then it fades to white and disappears. This is a great little animation for showing the user an instant reaction for what the did.

The JavaScript looks like this:

$(tr).css("background-color", "rgb(255,200,200)");
$(tr).fadeOut(500, RemoveDomElement);

This works beautifully in Firefox, Safari, Opera and Chrome, but - of course - not in IE. IE will execute the code and finish the cleanup, but the actual fade-out animation isn't shown.

What can I do for IE?

Share Improve this question edited Sep 20, 2018 at 7:11 fabrik 14.4k8 gold badges57 silver badges71 bronze badges asked Feb 18, 2009 at 20:19 Kenny SmithKenny Smith
Add a ment  | 

1 Answer 1

Reset to default 10

Fade out (and remove) the child cells (TD) instead of the row.

Do this:

$(tr).children().css("background-color", "rgb(255,200,200)");
$(tr).children().fadeOut(500, RemoveDomElement);

Even though each of the TDs is doing it's own thing, this will work quickly enough to the human eye to be the same as just fading/removing the TR.

发布评论

评论列表(0)

  1. 暂无评论