I am working on a site www.tciprecision.com and I have a problem with my pages flashing to white.

When you click to visit a new page, it has to completely reload the background images (so I think) and it flashes to white before reloading. Once that page has been opened, the next time it is clicked on, the whole screen does not flash to white.

Does anyone have any tips at how I can avoid this?

Thanks!

    Set you <body bgcolor="#808080"> so it defaults. The background color will load before the rest.

      Because the page is php, it seems to have to wait and load the page, and shows white while it does this.

      I just tried the bgcolor with no luck.

      Any other ideas?

        get rid of this line:

        <style type="text/css"> @import url(/styles/main.css);</style

          I had added that after someone told me it might work. I'll delete it. But, that doesn't solve it...

          Thanks...

            There really isn't a way to get around this. The way a webbrowser works is that the page you were on is "trashed" while it waits for the next page to load. Each browser handles this action differently. Some hold onto the old page until they start to display information.

            If you really want to remove the "white" pages, you'll learn AJAX as that can remove some of the whitepages problem. I'm not saying it's the solution, but it's a solution or work around.

            You might try adding flush() somewhere in the script to push the contents that have been parsed by the PHP Parser to the browser. This may help minimize the white time. Just make sure you don't send stuff to the browser too soon, like before sessions and such.

              You could stream it, have some Javascript replace the innerHMTL of the body tag.

                Never heard of "Ajax", but thats what i have on my site, and i never see the page switch (I'm on 56k).

                  AJAX = Asynchronous Javascript And XML

                  It's a term only coined recently, but it's otherwise known as DHTML. It's basically using Javascript to better enhance the user experience so that the web is now seen as an instantaneous web program, not just a set of documents being served.

                  Obviously there are plenty of sites using it now, but as with anything "new", it's just scratching the surface. Although AJAX isn't new, it's really coming out of its shell now....

                    19 days later

                    I realize this is an old thread, but I wanted to add my 2 cents' worth to it...

                    I had this same problem, and I was using the @import method. I solved it by doing this:

                    <link rel="stylesheet" type="text/css" href="templates/defaultTemplate/style.php" media="all" />
                    <style type="text/css" media="all">
                    <!--
                    @import url(templates/defaultTemplate/style.php);
                    -->
                    </style>

                    It's probably wasteful, wrong, etc. but it works.

                      Thanks! What exactly would the style.php page contain?

                        Oh, that was just my custom CSS style generator, just link to your normal CSS file there.

                          Looks to be a browser-specific rendering differnece. Works for me in IE, doesn't in FF.

                          Doesn't seem to be a good way to do it without redesigning your website using something like AJAX.

                            This could possibly be a caching issue. You might want to check the server configuration and headers being sent and remove headers that invoke non caching methods unless you really need them. This doesn't look like the css flashing issue, i've seen that and had it before. If that doesn't work, do you have access to another server where you could post a mirror of your site for testing purposes?

                              Write a Reply...