JQuery Load all images inside div before display

lomp

New Member
I want to load every image inside a div before actually displaying them. I have something similar to this:\[code\]<div><img src="http://stackoverflow.com/questions/12810878/1.jpg" /><img src="http://stackoverflow.com/questions/12810878/1.jpg" /><img src="http://stackoverflow.com/questions/12810878/1.jpg" /><img src="http://stackoverflow.com/questions/12810878/1.jpg" /><img src="http://stackoverflow.com/questions/12810878/1.jpg" /><img src="http://stackoverflow.com/questions/12810878/1.jpg" /></div>\[/code\]At first I tried doing things like:\[code\]$('div img').load(function() {$('div img').show();});\[/code\]Or this:\[code\]$('div').find('img').load(function() {$('div img').show();});\[/code\]Unfortunately, this didn't work because once the browser loads even just a single image, it fires the event. Any ideas on how to load everything first ? Thanks!
 
Back
Top