.load callback

Hi,

I’m using jQuery’s .call() method to insert some html into my document. I am using the callback ‘textStatus’ to resize the container the html has just been inserted into. This all works great but the resize() doesn’t wait until all the http requests have completed for the newly inserted html. As i have a few images and embedded Vimeo iFrame, it does the resize too soon and and cuts off the bottom of my html. Does anyone know how i can postpone the .resize() function call until the images and video have been loaded into the document?

Thanks!


$(target).load("get-wp-content/test-param" #wordpressContent", function (responseText, textStatus, XMLHttpRequest) {
	if (textStatus == "success") {
		$('.container').resize();
	}
});

Hi Banana Man,

If you have the height and width set for images, they’ll be allocated the proper space in the document before they’ve loaded. I imagine you can do something similar for the video too (what element are you using?)

Thanks,

I’ll give it a try. I am using a responsive design so wasn’t putting in image or video dimensions.