I am trying to accomplish the following: 1. On click, have a div with id="fader" fadeout 2. replaceHtml of fader with new html (this new HTML will appear below the fold of the browser) 3. Animate new HTML to slide up to the specified location
Step 1 and 2 are working, step 3 is not and I'm stumped as to why.
Here's the javascript:
$("#fader").fadeOut(1000, function() {
$(this).replaceWith('<div id=\"fader\" style=\"margin-top:-500px;width:500px;height:400px;border:1px solid black;\">new div</div>', function() {
$("#fader").animate({marginTop: "500px"});
});
});
Any thoughts on why the div won't animate would be greatly appreciated, thanks in advance!