Hi Jan,
Try changing this ...
$.getJSON(urlForDescription, function(data) {
$div = $("<div class='info'>" + data + "</div>");
$element.after($div).fadeIn();
});
to this ...
$.getJSON(urlForDescription, function(data) {
$("<div class='info'>" + data + "</div>")
.hide()
.insertAfter($element)
.fadeIn();
});
--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Dec 8, 2008, at 5:06 PM, Jan Limpens wrote:
On Mon, Dec 8, 2008 at 7:20 PM, MorningZ <[EMAIL PROTECTED]> wrote:
you'll have to do the fadeIn inside the callback of getJSON
var showDescription = function() {
$element = $("a.info", this);
if ($element.next("div.info").length == 0) {
var urlForDescription = $element.attr('href') + '/descricao';
$.getJSON(urlForDescription, function(data) {
$div = $("<div class='info'>" + data + "</div>");
$element.after($div).fadeIn();
});
} else {
$element.next("div.info").fadeIn();
}
}
also, just pops up. :(
--
Jan