473,320 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Help needed getting IE to behave

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
Jul 10 '08 #1
4 1340
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/
Jul 10 '08 #2
On Fri, 11 Jul 2008 01:24:24 +0200, John Hosking wrote:
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.
Yes I did. I'm still running win2K, so IE is stuck at 6 for me.
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.
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
Jul 11 '08 #3
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
Jul 11 '08 #4
Ian Hobson wrote:
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
Jul 11 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

67
by: Steven T. Hatton | last post by:
Some people have suggested the desire for code completion and refined edit-time error detection are an indication of incompetence on the part of the programmer who wants such features. ...
2
by: Vladislav Moltchanov | last post by:
Recently I have changed from Acc97 to Acc2000 (I had to supply some data entry tools for field data collection for users still using Acc97). Among lot of other complications coming with Acc2000...
5
by: SStory | last post by:
Hi all, I really needed to get the icons associated with each file that I want to show in a listview. I used the follow modified code sniplets found on the internet. I have left in...
10
by: hzgt9b | last post by:
Using VS2005 (.NET 2.0), VB.NET, I have a windows forms application. I have a StatusStrip containing a ToolStripStatusLabal and a ToolStripProgressBar. I want to force the status label to behave...
185
by: jacob navia | last post by:
Hi We are rewriting the libc for the 64 bit version of lcc-win and we have added a new field in the FILE structure: char *FileName; fopen() will save the file name and an accessor function will...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.