I have written a jQuery image resize script that works fine when the images are clicked using the handler, $('img').click (function(){. (see example here)
However I want to set it to run as soon as the page is loaded but $('img').load(function(){ doesn’t work. (see example here) I’m assuming it’s because it’s running the script after the DOM has loaded but not the images. But If I’m honest I don’t know.
You could do: