Here is the HTML content of a mosaic of images.
<div id="container">
<img id="1" />
...
<img id="20" />
</div>
This script is creating a mosaic from the images after page has been loaded or resized.
<script>
function create_mosaic(){
/*creates mosaic by resizing and arranging images in container*/
}
jQuery(window).load(function() {
create_mosaic();
});
jQuery(window).resize(function() {
create_mosaic();
});
</script>
However, if the HTML content requested by AJAX request, this script cannot work, since window.load is not being triggered. For this case, I am thinking about calling create_mosaic()
function after all images have been loaded. For that purpose, how can I check if the HTML is requested by AJAX request ?