8

Possible Duplicate:
Controlling image load order in HTML

Is there a way to set the load priority or the loading sequence of images on a web site?

Community
  • 1
  • 1
Key-Six
  • 2,439
  • 2
  • 26
  • 22
  • You should provide more detail. Are you loading via JavaScript? (Post is tagged JavaScript) Do you mean via HTML only? – Joseph Yaduvanshi Apr 22 '12 at 16:33
  • 1
    you could use javascript dynamically to add css clases which has a background property attributes to the elements – david Apr 22 '12 at 16:34
  • @John Conde - I think that the system used in "Controlling image load order in HTML" is quite uneffective, when a site has hundreds of images on it. – Key-Six Apr 22 '12 at 16:37
  • @Jim Schubert - The images are loaded only as an img or as a background in div and td. – Key-Six Apr 22 '12 at 16:40
  • @david - I'm not sure what you mean exactly, is there an example please? – Key-Six Apr 22 '12 at 16:41

1 Answers1

0

You could use jQuery and try sth. like that:

$(document).ready(function() {
  var preloaded_image = $('<img />').attr('src', 'img.jpg');

  $('#img_div').append(preloaded_image);
});

This should cause the images to load after the rest of the content.

tbraun89
  • 2,246
  • 3
  • 25
  • 44