> http://htmlgems.com/example/ex2b.html is the example page.
>
> Can someone please tell me why it causes IE to lock up using 100% of the
> CPU, when viewed in a screen less than 700px wide?
I presume you mean, say, IE6, as opposed to, say, IE7.
You've got:
<!--[if lte IE 6]>
<style type="text/css">
div#main{
width: expression(document.body.clientWidth < 600 ? "700px"
:(document.body.clientWidth > 1000 ? "1000px"
: "100%"));
etc.
Well, I've never done much with IE's expressions, but it looks to me as
though you are specifying (among other things): When the body (very
roughly, the browser window) is less than 600px, set the width of the
div#main to be *700px*. I guess you're hoping for a scrollbar to appear,
as it does in FF2 (which observes min-width).
I further guess that IE is thrashing around infinitely trying to put
fourteen eggs in a carton for a dozen, and then figuring out how many
eggs are in there (or, uh, something like that).
Actually, it seems to hang at about 640px (in my IE6). Don't know what
that indicates.
> And also what, if anything I can do about it.
Some possibilities:
1) Drop the min-width attempt for IE < 7 entirely; or
2) Change the 700 to 600, just to see if it helps. You set min-width to
600 for non-IE UAs anyway; or
3) Wait for somebody wiser than myself to come along and explain the
phenomenon; or
4) Fetch a chicken and resort to voodoo under the full moon.
GL

Signature
John
Pondering the value of the UIP: http://improve-usenet.org/
Ian Hobson - 11 Jul 2008 11:38 GMT
>> http://htmlgems.com/example/ex2b.html is the example page.
>>
>> Can someone please tell me why it causes IE to lock up using 100% of
>> the CPU, when viewed in a screen less than 700px wide?
>
> I presume you mean, say, IE6, as opposed to, say, IE7.
Yes I did. I'm still running win2K, so IE is stuck at 6 for me.
> You've got:
> <!--[if lte IE 6]>
[quoted text clipped - 14 lines]
> fourteen eggs in a carton for a dozen, and then figuring out how many
> eggs are in there (or, uh, something like that).
Yes. I can see the thrash now....
onLoad - Width is 550 so Set width to 700px, and recalc
onrecalc - width is 700, so set width to 100% and recalc
onrecalc - width now 550 so set width to 700px and recalc.
etc.
> 1) Drop the min-width attempt for IE < 7 entirely; or 2) Change the 700
> to 600, just to see if it helps. You set min-width to 600 for non-IE UAs
> anyway; or
> 3) Wait for somebody wiser than myself to come along and explain the
> phenomenon; or
> 4) Fetch a chicken and resort to voodoo under the full moon.
If the neighbour's Siamese is still in heat on the 18th July I will use
cat entrails :)
I have changed the page, and now the colours work, but the widths do not.
the width is applied to the body tag (which tests show works)
and yet the expression appears to be ignored.
Regards
Ian
Ian Hobson - 11 Jul 2008 12:32 GMT
Cracked it!
The width IE returns with clientWidth includes padding!
So it in necessary to reduce the width value, if clientWidth < 600 to
well below 600px. I've tried 580px and that solves the problem.
My guess is that if I set it to 600px, then clientWidth was returning
something line 605, and triggering the loop.
Hope this helps people following.
Regards
Ian
Jonathan N. Little - 11 Jul 2008 14:36 GMT
> Cracked it!
>
[quoted text clipped - 7 lines]
>
> Hope this helps people following.
Of course your application is with MS proprietary css "expression"
doohickey, but clientWidth is supposed to include the padding in the
value and this is not an IE-only "feature".

Signature
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com