I'm pulling some info from a database then putting it into a DIV and injecting all that in to my page. The problem I have is positioning the newly injected DIV after it has finished loading.
Here's my jQuery:
$j(document).ready(function() {
$('a#load-content').click(function(event) {
event.preventDefault();
var productId = $j(this).attr('id').replace(/more-info-/, '');
$j.getJSON('../json/quicky/product/id/' + productId, function(json) {
var productImage = json.image;
var html = '<div class="quick-info"><img src="' + json.image + '"/></div>';
$j(body).append(html);
});
});
$j('div.quick-info').load(function() {
positionBoxCenter();
});
});
I've tried placing the load event for the quick-info DIV after the load-content click event, inside the getJSON callback function, before the load-content click event, and inside the load-content click callback function. I still can't get it working.
What am I doing wrong with the load function?