2

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?

Thanks.

3
  • 1
    What does jolt/flicker? The page? The page contents? The part you are doing load() on? Commented Aug 8, 2010 at 15:11
  • Are you using the asynchronous xhr? If it's synched, your page will "freeze" until the data is loaded. Commented Aug 8, 2010 at 15:18
  • Hi, I am simply using jquery .load() function and it's the actual page contents, i.e. the DIV I am applying the .load() to. Commented Aug 8, 2010 at 23:58

1 Answer 1

2

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().

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.