Ian Hobson wrote:
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
--
John
Pondering the value of the UIP:
http://improve-usenet.org/