I'm glad you brought this up, I was going to need it soon. I ran your test case (thanks for giving one) and noticed that if you size the window to like 150px and reload it does resize up or down fine until it reaches the >310 case and then it gets stuck.
> width: expression(document.body.clientWidth > 310 ? "300px" : "auto" ); > margin: 10px; /* DELETE THIS AND EVERYTHING RESIZES AS EXPECTED */ I think that problem is because the box is over-constrained when clientWidth is <= 310. You are telling it you want a 10px margin which implies a width of clientWidth-20px. Perhaps it forces the margins in those cases and does not recompute it? Given that we're talking IE it may not apply, but here is the standard: http://www.w3.org/TR/REC-CSS2/visudet.html#q6 With that in mind, this seems to work: width: expression(document.body.clientWidth > 310 ? "300px" : "auto" ); margin: 10px expression(document.body.clientWidth > 310 ? "auto" : "10px" ) 10px 10px; You might expect "10px auto 10px 10px" to work but it doesn't; the expression has to be there. Firefox seemed to pick up the 10px margin spec and apply it to all sides, but it might have to be protected in some way to prevent some browsers from seeing it. Or you could go to conditional comments. > The workaround, for some reason, is to set the DOCTYPE > at HTML 3.2 or below, or to not set the DOCTYPE at all. At that point it's using the non-standard quirks mode, which probably has different rules. To paraphrase an old joke, "When people have a problem with HTML4 Strict in IE, they sometimes say 'Hey, I'll use quirks mode.' Now they have two problems." _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
