As you can tell, detecting when images have loaded, especially if they are cached, is a tricky business. Luckily, Andrée Hansson and Paul Irish have done a bunch of work in this area which should make your life easier.
$.event.special.load replaces jQuery's .load() event with a special event that will fire regardless of whether the image is cached.
imagesLoaded plugin allows you to execute a callback when all the images in a given set have loaded.
Didn't explain why $('.slideshow li img').load... doesn't work. But the latter imagesLoaded function worked beautifully. I added a class to the images which would initialize my callback (first two images), then ran the script. Awesome.
internetbudi is correct that using  will return the DOM element rather than the first jQuery element. Although his answer works, it generates a little more memory overhead when using that method (and the code isn't pretty either). You have two other options that are native to jQuery to retrieve the first element in the collection: .first(), or .eq(0)
Leave a comment on linxor's reply
Change topic type
Link this topic
Provide the permalink of a topic that is related to this topic