开发者

jQuery .load() Queries/Performance

开发者 https://www.devze.com 2023-01-10 13:03 出处:网络
With using the jQuery .load() function, I find that at initial load, my web page performing the .load() routine tends to jolt/flicker for a sec when loading.

With using the jQuery .load() function, I find that at initial load, my web page performing the .load() routine tends to jolt/flicker for a sec when loading.

Once loaded though, the page is displayed instantaneously.

Can anyone suggest a means of perhaps loading these pages into cache or some other means to prevent this jolt/flicker when loading?

开发者_C百科

Thanks.


I had this same issue. Here's a trick. Make sure you load your data into a div that you have hidden with .hide(). Then to make the data you just appended or loaded into there visible, just do .show. This way, it will fade in instead of jolting in. You can also use the jQuery slideDown() or slideUp() which is essentially the same as show().

0

精彩评论

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