Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8582681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:21:10+00:00 2026-06-11T21:21:10+00:00

On a website, I’m experiencing a flash of white that occurs between page loads.

  • 0

On a website, I’m experiencing a “flash” of white that occurs between page loads. It looks bad because I’m using a background image and when the page loads, the background images flash before it comes onto the screen (take a look for yourself). This issues occurs in chrome and IE but not in firefox.

The site has a way of preloading stuff. Every element on the page is in a div wrapper #website which is initially at display:none, and every image is in a div wrapper #website-images which is also hidden. Then the site (using a jquery plugin) checks to see if all the images in #website-images are done loading, once they are a cookie is set to remember that this user has loaded the images already so it won’t go through the preloading process once they go to another page or reload the current one, then a call to $("#website").show() is made to display the webpage.

So what could be causing this flickering between the page loads? Is it my way of preloading images? I’ve added different doctypes, and changed meta information but NOTHING has worked. I’m really lost here, does anyone have any ideas or insights?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:21:12+00:00Added an answer on June 11, 2026 at 9:21 pm

    This is happening because the DOMLoaded event is fired enough milliseconds before the page actually renders.

    In a nutshell, this means you have to optimise your website’s speed. This doesn’t mean to make it download faster, but it means to download in the correct order, in a non-blocking way.

    Step one: Your markup

    1)
    It seems there is a lot you can do to optimise your markup. Firstly, the order of stylesheets and JavaScripts can be optimised. To ensure CSS files are downloaded asynchronously, you always have to include external CSS before external JavaScript files. style.css is downloaded after some/all of your JavaScript calls.

    There is 1 script block found in the head between an external CSS file and another resource. To allow parallel downloading, move the inline script before the external CSS file, or after the next resource.

    2)
    Your main JavaScript file is inline within your markup. Not only does this block the page download until the script has finished downloading, but having it before your content is probably causing (or adding to) the white flash.

    Loading your script asynchronously in the head is my preferred method. You will then have to trigger your script when the DOM has finished loading, or you can achieve the same result by placing the script at the bottom of the body tag.

    Step two: Harness the browser’s capabilities

    1) Looking at the http headers, there are 28 items being served as separate HTTP calls, that are not being cached on the browser (including the html pages, jpg images, stylesheets and JavaScript files).

    These items are explicitly non-cacheable, and this can be easily fixed by editing your webserver’s configuration.

    2) Enable gzip compression. Most web browsers (yes, even IE) supports gzip decompression, and most (if not all) web servers support compressing using gzip. You could even go overkill and look into SPDY, which is an alternative lighter HTTP protocol (supported in Chrome and Firefox).

    Step three: Content serving

    There are around 30 individual items being served from your domain. Firstly, consider how you could reduce this number of requests. 30 HTTP requests per page view is a lot. You can combat this using the following methods:

    1) Paralleled downloads across multiple hostnames. Browsers currently limit the number of concurrent connections to a single domain. Serving your images from a separate domain (for example, img.bigtim.ca) can allow them to be served in parallel to other content.

    2) Combine multiple items into one. Many items that are downloaded are purely style content, such as the logo, menu elements, etc. These can be combined into a single image (downloaded only once), and split using CSS. This is called CSS spriting. Stack Overflow does this: look here.

    3) If you cannot reduce the amount of items needing downloading, you could reduce the load on your server (and in turn, the client’s browser) by serving static content from a cookieless domain. Stack Overflow does this with all their static content such as images, stylesheets and scripts.

    Step four: Optimise your own code

    There’s only so much that HTTP and browser technology can do to help your website’s speed. This last step is down to you.

    1) Is there any reason you choose to host jquery yourself? Jquery’s download page shows multiple CDNs where you can point to for speedy, cached script downloading.

    2) There are currently over 20 unused CSS rules within your stylesheets (that’s 36% of your entire CSS file). Have a re-think of what is really needed.

    3) The main chunk of JavaScript (at the top of your body tag) seems to be a hack to attempt to speed things up, but is probably not helping anything.

    A cookie is being set to specify whether or not the page has faded in yet. Not only are you using JavaScript to perform a transition which can happily be performed by CSS, but more than half of the script is used to define the functionality for reading and writing the cookie.

    Seeing things like this: $("body").css ("background-image", "url('images/background.png')"); and $("#website").show (); usually gets me ranting about “separation of concerns”, but this answer is long enough now so hopefully you can see that it is bad practice to mix style and functionality in the same code.

    Addendum: Looking at the code, there is no need for jquery at all to
    perform what you are doing. But then again, there is no need to
    perform what you are doing, so you could probably do better without any
    JavaScript at all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My website is configured to display a custom HTML-page when an error occurs. This
A website that I've been working on was originally created using XHTML 1.0 Transitional
My website sets and loads cookies that are 200 characters long. Is this too
My website was designed for firefox, and now that I've got most of the
A website I've been working on will not match data using a PHP (preg_match)
My website has a sponsorship system that allows users to invite friends by email
My website structure is a header, content, footer. My goal is that every time
My website (running on the express framework) suddenly started complaining that it needed a
Website: http://tinyurl.com/2c5cxkc This website loads fine on Safari/Chrome/Firefox. A number of people are having
My website has a search procedure that runs very slowly. One thing that slows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.