473,322 Members | 1,307 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,322 software developers and data experts.

New CSS rule craches IE !!

Today I added this rule to my web site:

#container {
min-width: 950px;
width:expression(document.body.clientWidth < 950? "950px": "auto" );
}

And it crashes IE when the width of the window is less than 950px :(
How would you correct it?

--
Boost the visibility of your web site in Google!
http://www.digitalpoint.com/tools/ad-network/?s=5203

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

http://www.auriance.com - http://www.auriance.net
Jul 21 '05 #1
7 4913
On Fri, 04 Mar 2005 14:03:46 -0300 Unknown User wrote:
Today I added this rule to my web site:

#container {
min-width: 950px;
width:expression(document.body.clientWidth < 950? "950px": "auto" );
}

And it crashes IE when the width of the window is less than 950px :(
How would you correct it?


You fix the problem by using a browser that understands the new rules.
You are attempting to utilize a code that older browser just will not
recognize.
Just because a new rule got implemented doesn't cause the browser to
automatically accept it.
Last week you got a speeding ticket for doing 65 in a 55 zone.
This week the law changed the speed limit to 65.
Are you still guilty? Yep.
Jul 21 '05 #2
Unknown User wrote:
Today I added this rule to my web site:

#container {
min-width: 950px;
width:expression(document.body.clientWidth < 950? "950px": "auto" );
}

And it crashes IE when the width of the window is less than 950px :(
crash confirmed ! :(
How would you correct it?


min-width: 950px;

bad luck, its not supported by Ie

Jul 21 '05 #3
Richard wrote:
On Fri, 04 Mar 2005 14:03:46 -0300 Unknown User wrote:
Today I added this rule to my web site:

#container {
min-width: 950px;
width:expression(document.body.clientWidth < 950? "950px": "auto" );
}

And it crashes IE when the width of the window is less than 950px :(
How would you correct it?

You fix the problem by using a browser that understands the new rules.
You are attempting to utilize a code that older browser just will not
recognize.
Just because a new rule got implemented doesn't cause the browser to
automatically accept it.


You're misunderstanding the situation. The "expression" code the user
posted *only* works in IE, and he's using it as a work-around for the
fact that IE doesn't recognize the min-width property. It's a trick
that's been posted here from time to time.
Jul 21 '05 #4
On Fri, 04 Mar 2005 16:17:34 -0300, Harlan Messinger
<hm*******************@comcast.net> wrote:
You're misunderstanding the situation. The "expression" code the user
posted *only* works in IE, and he's using it as a work-around for the
fact that IE doesn't recognize the min-width property. It's a trick
that's been posted here from time to time.


That's right. What do you suggest beside a PHP browser detection?

--
Boost the visibility of your web site in Google!
http://www.digitalpoint.com/tools/ad-network/?s=5203

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

http://www.auriance.com - http://www.auriance.net
Jul 21 '05 #5
> min-width: 950px;
width:expression(document.body.clientWidth < 950? "950px": "auto" );
crashes IE when the width of the window is less than 950px :(


Some suggestions:

1. Try IE7 (dean.edwards.name)
2. If IE7 works but it's too slow, work out what is is doing and just
do that. I suspect that it just calls the setExpression method from
javascript and adds an expression very similar, but perhaps subtley
different, to what you have.
3. Put something 950px wide inside the container (e.g. an empty div).
I think this has just about the same effect, doesn't it?
4. Ignore it.

--Phil.

Jul 21 '05 #6
"Unknown User" <me@privacy.net> wrote in message news:<op.sm4hokjer3xrds@cinza>...
Today I added this rule to my web site:

#container {
min-width: 950px;
width:expression(document.body.clientWidth < 950? "950px": "auto" );
}

And it crashes IE when the width of the window is less than 950px :(
How would you correct it?


I ran into this the other day, after finding the technique at
http://www.svendtofte.com/code/max_width_in_ie/ - I found the
expression was only working when the document was missing a doctype,
thereby putting IE in quirks mode. The solution when in standards mode
is to have something like:

width:expression(document.body.clientWidth < 950? "940px": "auto" );

instead of what you have above.

You could also try this Javascript solution:

http://www.doxdesk.com/software/js/minmax.html

This lets you use min/max-height and min/max-width seamlessly, though
does rely on IE users having Javascript enabled for it to work.

Hope that helps,

paul haine
http://joeblade.com/
http://design.joeblade.com/
Jul 21 '05 #7
paul haine wrote:

width:expression(document.body.clientWidth < 950? "940px": "auto" );

You could also try this Javascript solution:


FYI, width:expression also requires JS enabled for it to work

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 21 '05 #8

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

Similar topics

5
by: Terry Coccoli | last post by:
We have a Siebel implementation and for one query that was taking a long time to run I asked a DBA to evaluate the explain plan. I noticed that he chose to evaluate the Rule based optimization. I...
6
by: Chris Travers | last post by:
Hi all; I am using PostgreSQL 7.4 on RedHat 9, though I don't think that is important to this problem. I am attempting to write a rule that will check to see whether certain conditions are...
2
by: Joey P | last post by:
Hi all, I am doing a project for university whereby i have to implement a simple database related to a frozen foods company. I am having some trouble though creating a validation rule for one...
3
by: Yahoo | last post by:
GO TO http://sourceforge.net/projects/sdsre/ TO GET THE LATEST VERSION!!! SRE (Simple Rule Engine) is a lightweight forward chaining inference rule engine for .NET. Its 'simple' because of the...
4
by: Chris Kratz | last post by:
Hello all, We have run into what appears to be a problem with rules and subselects in postgres 7.4.1. We have boiled it down to the following test case. If anyone has any thoughts as to why...
1
by: Prabu Subroto | last post by:
Dear my friends... I want to drop a rule but I get an error message. Could you tell me my I can not drop (delete) the rule? Thank you very much in advance. ps: Here is my try underbelow: ...
1
by: Net Virtual Mailing Lists | last post by:
Hello, I have a table with a rule that goes something like this: CREATE OR REPLACE RULE sometable_delete ON DELETE DO delete FROM cache WHERE tablename='sometable'; CREATE OR REPLACE RULE...
8
by: markjerz | last post by:
Hi, I basically have two tables with the same structure. One is an archive of the other (backup). I want to essentially insert the data in to the other. I use: INSERT INTO table ( column,...
1
by: MLH | last post by:
Anyone remember if A97 append query failure would ever report data breaking validation rule when such was not the case. I have an old SQL statement - several years old now. I've encountered a case...
1
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: 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)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.