[thelist] CSS and expressions

Burhan Khalid burhankhalid at members.evolt.org
Thu Nov 7 06:56:00 CST 2002


EF> height:expression(document.body.clientHeight-159);
EF> Where 159 is the total height of the other page elements. This is not really
EF> the way I would prefer to have it. I know this is wrong but is there some
EF> way of doing something like this:
EF> height:expression(document.all.getElementByID('elementname').style.height)
EF> or maybe
EF> height:document.all.item("elementname").style.height;
EF> ????

Interesting problem, I had a similar (dynamically writing CSS)
problem, but not quite as complicated as yours. I had to think hard to
get my head around what you were trying to accoplish.

The problem could be made easier if you use absolute widths, so you
always know what the number is that you want to reduce from. If you
hadn't thought of that, then that could be something to look into.

If the element that you want to adjust comes after the element that
you are wanting to get the values from, then I /think/ you can use
javascript+DOM to write the value into the expression (much like your
example). What I'm talking about (and probably is wrong) :

[...]
<div id="el1" >
<script type="text/javascript">
echo "<div
style=\"height:"+document.all.getElementByID('el1').style.height-12+"\"";
</script>
[...]

Someone more knowledgeable than I on this could help you out better --
but I think it should get you started on something.


--
*---------------*
| Burhan Khalid |
*---------------*-------------------------------*
| Email : burhankhalid[at]members.evolt.org     |
| Web   : members.evolt.org/burhankhalid        |
| ICQ   : 6016166                               |
| AIM   : digitz0819                            |
| MSN   : burhankh[at]hotmail.com               |
| Yahoo : burhan_khalid                         |
*-----------------------------------------------*
| mushkil hai zabas kalaam mera ai dil          |
| sun sun ke ise suKhan_varaa.N-e-kaamil        |
| aasaan kahane kii karate hai.n faramaaish     |
| goim mushkil vagaranaa goim mushkil           |
|-----------------------------------------------|
| Too hard to grasp is my verse, O heart!       |
| Hearing it, the connoisseurs of art           |
| For a simpler style do ask                    |
| Difficult, if I write, difficult, if I do not |
*-----------------------------------------------*




More information about the thelist mailing list