I'm think I'm going mad.
All I want to do is get the dimensions of data loaded via AJAX regardless of how many times the call is made. It works fine the first time, but I always get a value of 0 with each subsequent call - despite the fact that it appears on the page, as one would expect.
// The AJAX part
function getDetails(request){
$placehold.empty();
return jQ.get(request);
};
// Filter & render AJAX data
function renderData(data){
var endResult = $(data).find('#productDetails');
endResult.fadeTo(0,0).appendTo($placehold);
$placehold.removeClass('loading');
endResult.fadeTo(300,1); // <- Added as per request
// Console log previously uncalled data works fine
// Called again, I get zero every single time
console.log( jQ('#anyElementInAJAXData').outerHeight(false) );
};
// Click handler
jQ('#slides').on('click', '.slideLink', function(e){
e.preventDefault();
var target = jQ(this).attr("href");
$placehold.fadeIn(360).addClass('loading');
getDetails(target)
.done( function(result) {
renderData(result);
})
});
What am I doing wrong?