Not full-time javascript dev. I'm loading some external html via AJAX / JSON as a string and then placing it in the DOM.
The json will look like this:
{
user_ids:[2,4,7],
html:"<div class='show-fade-in' >here is text</div>"
}
I'd like to give the user some feedback by animating in the effect so that they will notice it rather than having it just appear which might make them miss it. I would like to use a technique similar to this: http://jsfiddle.net/SO_AMK/a9dnW/3/ linked to via https://stackoverflow.com/a/11681331/152825 . My question is how would I capture the event of loading the external json and putting into the DOM so that we can start the animation in the element 'show-fade-in'.
I'll be adding the html via something like:
so:
$.get('/arc/external-info',function(){},'json'
).done(function(r){
$('#item-editing').append(r.html);
// EDIT #1 this doesn't word
$( ".show-fade-in" ).fadeIn( "slow", function() {
alert('fade-in complete');
});
})
thx for any help