Forum Moderators: open

Message Too Old, No Replies

Min and max with with CSS expressions

how?

         

misha

6:20 am on Jul 2, 2005 (gmt 0)

10+ Year Member



Hi there,

I want to have an expression like this in my CSS:

#wrapper {

width: expression(document.body.clientWidth < 595? "595px": "80%" );

width: expression(document.body.clientWidth > 700? "700px": "80%" );

}

However this doesn't work because if the width is less than 595 then when it gets to the second width statement it will make the width 80% again.

I need to somehow combine these expressions like this:

width: expression(document.body.clientWidth > 700
[&& document.body.clientWidth!= "595px"]
? "700px": "80%" );

Is there a way to do this?

thanks

misha

5:13 pm on Jul 8, 2005 (gmt 0)

10+ Year Member



no one has an idea about this? can I write a javascript function that works via a CSS?