I would like to fadeOut() an image on the page and remove it from the DOM after the animation is finished. Sounds easy enough?

Example code (image has the id "img1"):

```

   $("#img1").fadeOut("slow", function() { $(this).remove() });

```

This does does not work. When I inspect the page with Firebug the image is still there. It is just hidden.

Second example which should kind of flash the image:

```

   $("#img1").fadeOut("slow", function() { $(this).fadeIn() });

```

Strange.

---

Thanks for the example pages which work great and as expected.

The problem must be something else and only occurs in my project environment.

Side note: when I do a simple console.log($(this)) in my callback function the result is the window object itself?!

When I find out what side effects create the problem I'll update this question.