Forum Moderators: not2easy

Message Too Old, No Replies

Expressions in CSS

         

strai

12:24 pm on Sep 2, 2009 (gmt 0)

10+ Year Member



Hi,

I have the following problem. I have a style sheet which contains 13 expressions like:

#links {
height: expression(document.body.clientHeight - getpos_top(document.getElementById('links')) - 20);
}

However, there is one big drawback: Each time i move my mouse the expressions are being evaluated which means that each second the function 'getpos_top' is being calculated which makes my application really slow.

Is it possible to use expressions without evaluating them 1000 times per second when i move my mouse?

mattur

1:53 pm on Sep 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There's three big drawbacks to using CSS expressions:

1. They are only supported by IE5-7 [msdn.microsoft.com]; no Firefox, Safari, Chrome etc support.

2. They are deprecated in IE8 [blogs.msdn.com], and only work when in IE7 mode or quirks mode.

3. Performance is appalling [developer.yahoo.net].

Avoid. Use standard CSS to style your website instead.