开发者

Jquery loading prespective

开发者 https://www.devze.com 2022-12-21 12:48 出处:网络
My web page is divied into different section in that in one section having images gallary. to load the other section i am performing ajax calls. in following method.

My web page is divied into different section in that

in one section having images gallary.

to load the other section i am performing ajax calls. in following method.

$(document).ready(function(){ 
  // Perform other task here
} 

My issue is if image takes time to load other stu开发者_开发技巧b is waiting to load images.

I want to make image loading as secondary and my ajax stub on first priority.

Please suggest Thanks


Not sure if I understood your question, but wouldn't that be the case of:

$(document).ready(function(){ 
  Perform first task
  And now the second task
} 

One other thing you could do, is calling your image loader right at the bottom of the page, that way, it will be the last thing to be loaded.

OR

You could ad setTimeout, so the call to your function to display images would only happen x-seconds after the load.


$(document).ready does not wait for images to load.

0

精彩评论

暂无评论...
验证码 换一张
取 消