I’m currently working on a JQuery game (Just to get around with using JQuery) and on certain collisions, an “explosion” class is created.
Right now I’m using $("#game").append("the div html code goes here") to add it in the game div. Now, how do I make it so after the element is created, it fades out after being created? I tried doing something along the lines of $(".explosion").load(function goes here) but that doesn’t seem to work :\
You can do it like this:
If you want to get rid of it after it fades out, you can do this:
Working demo here: http://jsfiddle.net/jfriend00/qbJgh/