Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How can I control the order of how the images load on a web page?

user-image
Question added by Mohamed Elabnody , IT & Foreign Purchase Manager , Egyptian Swedish co.
Date Posted: 2013/09/17
Fadi Alkhateeb
by Fadi Alkhateeb , Senior Front End Developer , NexTwo

You will need to use javascript to control order of loading images in the page, you can write custom javascript and use setTimeOut function, or you need to use lazyload plugs by jQuery or others.

 Below are some of js samples you can use:

http://luis-almeida.github.io/unveil/

http://jqueryfordesigners.com/image-loading/

http://www.appelsiini.net/projects/lazyload

 

Daanish Rumani
by Daanish Rumani , Product Manager , Publicis Sapient

One way is to use AJAX and control the order in JavaScript. Basically load tge second image only after the forst image is completely loaded.

Another way is to download all the images and keep them hidden. Then when all the images have been downloaded you can set one image at a time as visible.

Muhammed Ajmal Seeraveetil
by Muhammed Ajmal Seeraveetil , Software Engineer , Wipro

First of all Good Question !  ,Hope your question is

"how the browser (webkit) is rendering the webpage and diplaying the image contnet "?

My answer is regarding the "webkit" ,

order of rendering is a traversal of DOM tree (datastructure) (In order or postorder)

If you need specificaly control your image may use cleint side script like jquery , js  

Webkit Architecture

 

There are lot process taking place inoreder to diplay a image 

  • Webcore creates a DOM tree each html page 
  • Each Source URL of the image DOM object is downloaded and cached  
  • Image decoded and bit map image is given to graphics layer (Eg: OpenGL) 
  • For efficeincy and saving faster rendering images are cached  

More Questions Like This