Min-width for IE8 is rare that you will run into that bug since you generally don’t put it on columns to avoid drops, IE6 just doesn’t suipport it, and there is indeed a 1 size fits all (either expression) or the extra markup (Quiz 3) which does work flawlessly in all browsers
Ryan, I owe you a whole sack of cookies. I’ve cut/pasted Paul’s solution to the IE min-width dealie, and I’m going to spend some time tomorrow performing minor surgery on some sites to bring them into the fold.
It would be better to use padding instead of border because in IE6 it has a lmit on the border value, where as padding does not (and it does the same thing :))
Off Topic:
So I get a cake and a lot of cookies. Guys trying to pork me up for something ;)?
[ot]Now, the cake and cookies are for two different things. I’d take them all if it were me.
[/ot]
Nice tip about the padding.
Off Topic:
We were in Rotterdam yesterday so we popped into the mac shop just to giggle… and there was this thing I swear it was 27" or something and my web site just looked like one of those little centered 800px blog strips!
Yes, the limit IE6 will allow on a border v alue is 960px. After that you will need a second nested <div>to put some of the border on, and then of course a negative margin to drag it back over
Expressions are very slow (actually thousands of times slower) and should be avoided. Luckily there is a fix (from Steve Souders) that allows the expression to run once and then js takes over.
Hi Paul
I have always heard that expressions were resource hogs and I have been reading up on the subject lately.
I was looking around for a pure js script to replace a min-max width expression for IE6. I don’t know how to write js so I was looking for a pre-built script that I could adjust as needed. I found this min-width script at Robert Nyman’s blog.
I was hoping to find something like that script he posted that would take care of both min & max widths.
( I was trying to avoid anything that is dependent on a jQuery library )
Expressions are very slow
Now from my understanding a pure js solution would be slower than expressions. Exressions are constantly running and monitoring the events which make them faster but makes them resource hogs at the same time. Is that not right?
Or rather than saying “they are slow” did you mean “they are resource hogs”.
It looks like you have just what I was looking for in your demo.
So is that just an expression with an event handler tied in to it?
Javascript isn’t my area either but my understanding is that expressions slow the whole page down to a crawl so although they may be ready to react quicker the effect is in fact slower.
You only have to look at the fixed header and footer routines to see the page jumping wildly (although some of that jitter can be cured with an image on the html element) but they are always slower than a dedicated script.
Or rather than saying “they are slow” did you mean “they are resource hogs”.
Yes both as the net effect is to slow everything down
For a resize script you only want it to work when the window is resized and not when the mouse is just moving across the screen.
It looks like you have just what I was looking for in your demo.
So is that just an expression with an event handler tied in to it?
That’s the main reason I book Steve Souders book to get that routine It simply evaluates the expression to a fixed pixel size so that it only runs once when the page is first drawn. From then on the Javascript takes over only when the window is resized.
This is the original example which I adapted to my layout. It probably doesn’t make best use of the routine as I am only setting then min and max width of a few elements. Feel free to borrow and improve as I just play around with this stuff
Ray, I came across Nyman’s site some time ago, and promptly lost track of it in my forest of bookmarks. Thanks for bringing it up again. I’m going to give both his and Paul’s fixes a spin and see how they work. You’re right in noting that Nyman’s script only handles max-width issues.
Edit: Paul, your 3-col site uses a #wrapper to set min- and max-widths, and that’s what you hang your minmax JS from. In a structure without a #wrapper element or anything analogous, would it be kosher to hang the JS from the body tag if that’s where all the width and other elements are located?
In another thread, Paul listed some bugs in IE (or at least IE6) when the body was the one having set widths (in CSS)… so if those body bugs could be translated to JS than that might be a problem.
I’m also spinning my head into a loop trying to figure out how IE would change the width of the body… based on the width of the body (isn’t that what IE checks for viewport? body.clientWidth?).