3
3
3ds2011-10-26 14:17:09
JavaScript
3ds, 2011-10-26 14:17:09

How to find out when all the images in the block are 100% loaded?

The problem is this: there is a block, it contains about 50 small pictures ~ 128x120px. You need to know exactly when all the pictures are loaded and calculate their total width accordingly. Tell me how to catch the event on js (JQuery) when all the pictures are guaranteed to be loaded?
$('div images').load(..); // не пашет см. док-ю.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
L
lashtal, 2011-10-26
@3ds

jQuery imagesLoaded
github.com/desandro/imagesloaded

S
Sergey, 2011-10-26
Protko @Fesor

jQuery(window).bind('load', callback); //Гаррантированно!)

R
rPman, 2011-10-26
@rPman

the first result in Google noteskeeper.ru/35/

F
Finom, 2011-10-27
@Finom

Count the number of images, hang a load event on each image. If that number of loads worked, which is equal to the number of images, then, obviously, all the images are loaded.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question