Previous Message
Next Message

Re: [css-d] IE tweaks

Sent by Andrew Clover on 26 January 2002 22:10

Liorean [EMAIL-REMOVED]> wrote:

> I'm creating a general handler for fixed positioning, along with a fix for 
> left-right, top-bottom positioning pairs.

I've got a mini-script for the simplest form of fixed positioning, and
have just done (not tested fully) a script to implement min-width/max-height/
etc., in IE5+. It's nice that IE allows you to define CSS properties it
doesn't know about and read them from script, allowing us to make up for
its deficiencies! Like you said, hacks are much better kept in browser-
specific scripting than CSS.

Left-right/top-bottom positioning was next on my list. :-)

> To fix the box-model, I need a way to handle margin, padding, border.

You're also doing a pre-IE6 box model fix? Interesting... could require
some annoying calculations when mixed units are used.

> How should I do to catch both those when declared by "margin: blah;" etc. and 
> when they are declared by "margin-left:blah; margin-right:blah;" etc? I 
> fetch the values out of "<element>.currentStyle".

No problem here. Read the non-shortcut versions (eg. marginLeft) in
currentStyle and you'll get the correct value whether a shortcut was used
or not.

> Second, how do I through JScript set an expression in CSS to handle 
> positioning? I've heard of getExpression/setExpression, function setting or 
> setting a value of "expression(blah);" in CSS.

'expression(blah)' has to be written directly in CSS, you can't assign it
as a string to a style property through scripting. And it's really silly,
hiding scripting in a style sheet. Ugh. Better to use the setExpression
method of the style object. Docs here -

I am not convinced they offer anything one couldn't already do with normal
events. They certainly cannot magically work out when the expression has to
be re-evaluated. I'm currently trying to work out what IE's rules are about
expressions re-evaluation. The behaviour seems odd, somewhat random even. hmm.

Andrew Clover
Previous Message
Next Message

Message thread: