Ciao a tutti,
ho un problema a calcolare l'altezza di un div dopo che con una funzione inserisco al suo interno dei dati recupearti da un feed..
il codice è questo e il div è settato da css a height:192px;
codice:
jQuery.ajax({
url: 'http://gdata.youtube.com/feeds/api/videos/'+videolink+'?v=2&alt=json', dataType: "jsonp", success: function (data) {
getComments(data.entry.gd$comments.gd$feedLink.href + '&max-results=50&alt=json', 1);
}
});
function parseresults(data) {
getComments(data.entry.gd$comments.gd$feedLink.href + '&max-results=50&alt=json', 1);
}
function getComments(commentsURL, startIndex) {
jQuery.ajax({
url: commentsURL + '&start-index=' + startIndex,
dataType: "jsonp",
success: function (data) {
jQuery.each(data.feed.entry, function(key, val) {
uri = new String(val.author[0].uri.$t);
urlAuthor = uri.replace("http://gdata.youtube.com/feeds/api/users/","http://www.youtube.com/user/");
jQuery('#comment_feed').append('<span class="author">' + val.author[0].name.$t + '</span>
<span class="comment">' + val.content.$t + '</span>
<span class="time">' + prettyDate(val.published.$t) + '</span>
');
jQuery('#comment-wrapper').getNiceScroll().resize();
jQuery('#comment-wrapper').scrollTop(0);
});
jQuery('.write').remove();
jQuery('#comment_top').append('<span class="write"></span>');
}
});
}
il controllo che voglio fare è il seguente
codice:
var descCommHeight = jQuery('#comment_feed').height();
if (descCommHeight <= 192) {
alert(minore di 192);
} else {
alert(maggiore di 192);
}
non riesco a capire dove inserirlo per avere effettivamente l'altezza modificata..e non sempre 192..
dovrebbe stare alla fine della funzione quando tutti i dati sono stati caricati al suo interno..ma come fare?
Spero possiate darmi una mano..
grazie!!!