:: Forum >>

setStyle and CSS calc

Hi.

obj.setStyle("left","calc(99% - 210px)");

I belive it is right CSS, but it dosn't work.

Should it??

Oddbjørn
Thursday, May 8, 2008
I'm not aware of a CSS function called calc(). That doesn't mean there isn't one, but if you can point me to it here http://www.w3.org/Style/CSS/ I'd be willing to read it's specs.

On the other hand, assuming there is one, does your browser support it?
Anthony
Thursday, May 8, 2008
Hei.

Yes, you have right.

calc is in CSS version 3.0.

Here is the link any way:

http://www.w3.org/TR/2006/WD-css3-values-20060919/

section 3.74

I just to have to wait, or manage a other way.

Still, thanks a lot.

Oddbjørn
Thursday, May 8, 2008
If all current browsers implement this calc() function - live would be so much easier :-)
Alex (ActiveWidgets)
Friday, May 9, 2008
It would be even better if you could use JavaScript functions in the CSS properties. But I'd be happy just to be able to access the CSS properties from JavaScript.
Anthony
Friday, May 9, 2008
Actually, it is possible to use javascript functions in CSS -

#myDIV {
width: expression(this.parentNode.clientWidth/2 - 100);
}


http://msdn.microsoft.com/en-us/library/ms537634.aspx

Unfortunately this is available in IE only, and it also affects performance (if you use too many of them :-).

And, BTW you can manipulate stylesheets from javascripts as well -

document.styleSheets[0]....

http://msdn.microsoft.com/en-us/library/ms537489.aspx

Alex (ActiveWidgets)
Friday, May 9, 2008
Yes, I know. Unfortunately, IE isn't my preferred browser.

Right now, my resize javascript routine is coming together. I'm just ironing out the last issues I've uncovered with objects that have a float right style. It would be nice if I could access the styles from JS with FireFox. Unfortunately, I have to resort to passing extra parameters to the resize function.

Of course, while it mostly works fine with the Gecko-based browsers, IE is stuffed. Damn you, Bill Gates!
Anthony
Friday, May 9, 2008

This topic is archived.


Back to support forum

Forum search