Forum Moderators: open

Message Too Old, No Replies

Page flickers badly when loading in IE

Flicker is an understatement!...looks fine in FF

         

cstricklen

10:44 am on Oct 8, 2006 (gmt 0)

10+ Year Member



My main Category Pages on a Real Estate site are very annoying when opened in IE. The bottom 2/3 of the page disappears for a fraction of a second every time the page loads. In Firefox, etc., reloads are seamless and pretty. Is this a common problem with a known fix? Maybe I'm not describng the problem well in my search--I can't find it. Thanks for any suggestions.

kaled

11:06 am on Oct 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you have any <img> tags that omit dimensions?

If you only have a couple of images on a page, then omitting the width and height is normally ok, however, if you have a lot of images on the page, omitting any dimensions can cause problems.

Kaled.

tedster

5:47 pm on Oct 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try a search for "Flash of Unstyled Content" or "FOUC" -- one of the first discussions is here: [webmasterworld.com...]

cstricklen

10:33 pm on Oct 8, 2006 (gmt 0)

10+ Year Member



Thanks for your replies; no go, though:

1)There are a dozen or so thumbnails on the pages, but I have included the dimensions in the HTML. The other images are CSS background-images.

2)I read the thread from the link. I'm not using @import; I'm linking to an external stylesheet. Also, I do have a little date script on the page.

Still looking for a fix.

SuzyUK

10:37 pm on Oct 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



is your main layout a table or divs?

gippo

8:41 am on Oct 9, 2006 (gmt 0)

10+ Year Member



Might be the Peekaboo Bug. - do a search on that

Or in your settings have you got IE to check for newier versions of stored pages set to 'Every Visit to the page'?

cstricklen

5:19 pm on Oct 9, 2006 (gmt 0)

10+ Year Member



Suzy, good question. The part that flashes is a table, but since the rest of the site is completely CSS; and since it occurred to me that the table might be the problem; and since the reason I used a table in the first place (client edit) no longer exists (sales job :-) ), I want to replace the table with CSS. But....

Being a newbie CSSer, here is how I did one iteration:

#property {
width: 450px;
margin-left: auto;
margin-right: auto;
clear: both;
border-top: 1px solid #ccc;
}

#left {
width: 130px;
float: left;
padding-top: 3px;
margin: 30px 20px 30px 0;
}

#right {
width: 300px;
float: right;
margin: 30px 0 0 0;
}

<div id="property">
<div id="left">
<a href="100_photos_retail.htm"><img border="0" src="thumbs/100_001_th.jpg" alt=" " width="108" height="72"></a><br>
<p class="thumbtext">adress under thumb</p>
</div>
<div id="right">
<p class="description"><a class="strong" href="100_photos_retail.htm">BUILDING 100</a><br><span class="name">Building Name</span></p>
<p class="description">brief description</p>
<p class="description">rent</p>
<p class="description">when available</p>
<p class="description"><a href="100_photos_retail.htm">[Details and additional photos]</a></p>
</div>
</div>

Very nice, but I need a dozen or so properties on each page and I'm allowed an ID only once per page. That doesn't seem to make sense, since this works so well. Certainly I don't want IDs named property1, property2, etc.(?)

Anyway, I tried using classes, but then I'm not allowed a paragraph inside a span (which also works fine).

So how do I do this?

tedster

5:37 pm on Oct 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Certainly I don't want IDs named property1, property2, etc.(?)

Why not? You can have as many IDs as your mark-up needs - they just need to each have a different name.

#property1 {rules}
#property2 {rules}
#apple {rules}
#kangaroo {rules}

...etc.

Also consider if you can use descendant selectors [w3.org] to help make things more concise:

#property p {rules}

This would set rules for the content of any <p> tag within the #property div -- that is, any <p> tag that is a descendant of an element given the id #property. Then you don't need a special class declaration for each paragraph.

cstricklen

6:50 pm on Oct 9, 2006 (gmt 0)

10+ Year Member



Thanks. I like the descendant selector. So, with IDs, how unique is unique? For the example in my original post, is there a way to write the rules one time and have them apply to any div named propertysomething?

tedster

7:01 pm on Oct 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use class instead of id, and you can apply that ruleset as often as you need to. In your example code, you used class="description" -- in your css file, that would be:

.description {rules}

SuzyUK

7:20 pm on Oct 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hehe, I was only going to say you could likely firm up your table, and make it render faster by using table-layout:fixed; and making sure any image heights had been explicity specified.. but if you've decided the CSS route ;)

Anyway, I tried using classes, but then I'm not allowed a paragraph inside a span

don't quite understand that - Why would that involve putting a <p> inside a span..?

the code above is just fine, just change ID's #property, #left, #right to CLASSES .property, .left, .right, you can reuse the property div as you have it set up in the example as many times as you like in one page.

Further you can then still target the the <p> (using descendant selector as mentioned) in exactly the same way.

For instance in the left div (your thumbnail text) you wouldn't necessarily need another class on the <p> there as you can target it
.property .left p {rules}

however in the right side if you want to format the name description, available, rent etc.. differently you might like to add classes in there.

Suzy

cstricklen

8:59 pm on Oct 9, 2006 (gmt 0)

10+ Year Member



Yeehaw! I understand it. You guys rock! Now it's clean, elegant, looks perfect in all browsers, and it validates. Oh BTW, there's not a trace of the original flash problem.

Site=123 pages
Tables=0

See anything else that looks like a newbie wrote it?

.right p {
margin-top: 0;
margin-bottom: .5em;
line-height: 120%;
text-indent: 0;
}

.left p {
margin-top: 5px;
margin-bottom: 0;
font-family: arial, geneva, helvetica, geneva, sans-serif;
text-align: center;
line-height: 120%;
text-indent: 0;
color: #000;
}

.property {
width: 450px;
margin-left: auto;
margin-right: auto;
clear: both;
border-top: 1px solid #ccc;
}

.left {
width: 130px;
float: left;
padding-top: 3px;
margin: 30px 20px 30px 0;
}

.right {
width: 300px;
float: right;
margin: 30px 0 0 0;
}

<div class="property">
<div class="left">
<a href="link"><img alt=" " width="108" height="72"></a><br>
<p>address</p>
</div>
<div class="right">
<p><a class="strong" href="link">building number</a><br><span class="name">building name</span></p>
<p>brief description</p>
<p>rent</p>
<p>when available</p>
<p><a href="link">[Details and additional photos]</a></p>
</div>
</div>

cstricklen

10:23 pm on Oct 9, 2006 (gmt 0)

10+ Year Member



AAAAARGH! I uploaded the other main category pages, all identical except for content, and now they all flash again!

Any ideas? I love that I have them all converted to CSS, but I *really* don't like this flicker thing.

cstricklen

12:51 pm on Oct 10, 2006 (gmt 0)

10+ Year Member



Resolved. Thanks everybody for your help. (I took the script out of the source code and linked to it externally--just for tidyness--and it seems to have stopped the flashing problem.)