[jQuery] fadeIn something from JSON
Hello,
I have got this:
var showDescription = function() {
$element = $("a.info", this);
if ($element.next("div.info").length == 0) {
var urlForDescription = $element.attr('href') + '/description';
$.getJSON(urlForDescription, function(data) {
$div = $("<div class='info'>" + data + "</div>");
$element.after($div); // pop! :(
});
}
$element.next("div.info").fadeIn();
}
Problem is, that new descriptions will immediately pop up without
fadeIn. Subsequent hovers will work nicely.
How can I fadeIn this new element? I tried hiding it first (via css
and hide()), but then it did not show up at all (only on subsequent
hovers)...
Any ideas?
--
Jan