Connecting Tech Pros Worldwide Help | Site Map

Help needed getting IE to behave

  #1  
Old July 10th, 2008, 09:55 PM
Ian Hobson
Guest
 
Posts: n/a
Hi all,

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?

And also what, if anything I can do about it.

I have tried no div, a div within body with ID - nothing I have tried
works.

The color: CSS is only to prove the expression code is working.

Thanks

Ian
  #2  
Old July 11th, 2008, 12:35 AM
John Hosking
Guest
 
Posts: n/a

re: Help needed getting IE to behave


Ian Hobson wrote:
Quote:
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.
Quote:
>
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/
  #3  
Old July 11th, 2008, 11:45 AM
Ian Hobson
Guest
 
Posts: n/a

re: Help needed getting IE to behave


On Fri, 11 Jul 2008 01:24:24 +0200, John Hosking wrote:
Quote:
Ian Hobson wrote:
>
Quote:
>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.
Quote:
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).
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.
Quote:
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
  #4  
Old July 11th, 2008, 12:35 PM
Ian Hobson
Guest
 
Posts: n/a

re: Help needed getting IE to behave


On Fri, 11 Jul 2008 01:24:24 +0200, John Hosking wrote:

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


  #5  
Old July 11th, 2008, 02:45 PM
Jonathan N. Little
Guest
 
Posts: n/a

re: Help needed getting IE to behave


Ian Hobson wrote:
Quote:
On Fri, 11 Jul 2008 01:24:24 +0200, John Hosking wrote:
>
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.
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".

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript Best Practices Document v1.0 Matt Kruse answers 136 November 23rd, 2005 03:30 AM