theHaggis theHaggis - 1 year ago 56
Javascript Question

How to change background color to a <DIV /> then fade out, then finally remove from the DOM?

Hi I want to first change the background color of a

to red then fade out that
. Once the fade out is completed remove it from the DOM.

The following code does fade out the
and remove it from the DOM but it doesn't change the
to red.

$(this).find("div#" + id)
.css("background-color", "#ff0000")
.fadeOut("slow", function () {

Answer Source

See the working solution here:

<div id="div1">

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download