On 6/22/06, Gunlaug Sørtun <[EMAIL PROTECTED]> wrote:
> Tom Livingston wrote:
> >> Your expression is still triggered by a "fixed" pixel-width, and doesn't
> >> pick up and recalculate the trigger-point based on the browser's default
> >> font-size.
> >>
> >> Try this...
> >>
> >> #wrapper { width:expression(((document.compatMode &&
> >> document.compatMode=='CSS1Compat') ?
> >> document.documentElement.clientWidth
> >> : document.body.clientWidth) >(1850/12)
> >> * parseInt(document.body.currentStyle.fontSize)?  "50em"
> >> : (((document.compatMode && document.compatMode=='CSS1Compat') ?
> >> document.documentElement.clientWidth :
> >> document.body.clientWidth) <(750/12)
> >> * parseInt(document.body.currentStyle.fontSize)? "46em" : "100%")); }
> >>
> >> It's a tested and working expression, but I haven't tested and
> >> fine-tuned it for your layout - just "plugged in" suitable values.
> >>
> >> I'll write a separate 'min-width' only version later.
> >>
> >>         Georg
> >> --
> >> http://www.gunlaug.no
> >>
> >
> > No idea what the difference is, but it works great! Thanks so much!
>
> The difference is:
>
> your first attempt...
>
> document.documentElement.clientWidth :document.body.clientWidth) < 750 ?
> "46em" : "100%")); }
>
> ...vs. the corrected one...
>
> document.documentElement.clientWidth :document.body.clientWidth) < (750/12)
> * parseInt(document.body.currentStyle.fontSize)? "46em" : "100%")); }
>
> See that...
>
> < (750/12)
> * parseInt(document.body.currentStyle.fontSize)?
>
> ...? That's the calculation:
>
> " 'window-width in pixels', divided by '/medium/ font-size in points',
> multiplied by '/actual/ font-size in points' ".
>
> A clever bit of logic, don't you think? :-)
>
> > Can I increase the 1850 to something crazy so it will never be hit?
>
> It is already so crazy that it won't trigger on windows less than around
> 1850px recalculated the same as above. However, no problem replacing
> that 1850 with a larger value - any value.
>
> Or you may set "100%" instead of the "50em" I used, since that'll mean
> that no action will be taken when the 'max-width' trigger-point is reached.
>
> > Thanks again. Your very kind to help out!
> >
>
> No problem :-)
>
>         Georg
> --
> http://www.gunlaug.no
>

For the sake of the archives, here's the soluion I am using (including
the change of 50em to 100%) from "CSS Master" Georg

;-)

-- 


Tom Livingston | Senior Multimedia Artist | Media Logic |
ph: 518.456.3015x231 | fx: 518.456.4279 | mlinc.com
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to