ok, i would never ask anything so simple as this probably is, but:
i need a script/tut/code sample to monitor the width of a table.
example: if i'm making a centered web page (some don't like them, but coming from print I do) nested in a 3 column table (no CSS here), I need to know how wide the left column is for a Fireworks dropdown (was that clear enough?)
I've been through my O'Rielly "Learning JS" book time & again & can't find *anything* resembling what I'm looking for. Help!
obj.404 :: the JS neophyte
Quick Javascript Question
Page 1 of 15 Replies - 1057 Views - Last Post: 14 June 2002 - 10:34 AM
Replies To: Quick Javascript Question
#2
Re: Quick Javascript Question
Posted 13 June 2002 - 09:08 PM
Does it have to be dynamic?
Can't you just open the page in a wysiwyg and select the cell and have it tell you that?
Can't you just open the page in a wysiwyg and select the cell and have it tell you that?
#3
Re: Quick Javascript Question
Posted 13 June 2002 - 10:26 PM
Well here is a little IE javascript (it will not work with Opera, Moz, Netscape)..
That is a start you can work in the layers and all object referances if you need cross browser support but I didn't want to get into all of that.
Cheers Sam
<script>
function get_table(src){
return src.style.width;
}
document.write('the width of table 1 is: '+ get_table('table1'));
</script>
<table>
<tr>
<td id="table1">
this is the first column
</td>
<td>
column 2
</td>
<td>
final column
</td>
</tr>
</table>
That is a start you can work in the layers and all object referances if you need cross browser support but I didn't want to get into all of that.
Cheers Sam
#4
Re: Quick Javascript Question
Posted 13 June 2002 - 10:28 PM
The Neoracle, on Jun 13 2002, 10:08 PM, said:
Does it have to be dynamic?
Can't you just open the page in a wysiwyg and select the cell and have it tell you that?
Can't you just open the page in a wysiwyg and select the cell and have it tell you that?
see, that's the rub; it does have to be dynamic. Fireworks menus rely on absolute positions. w/o a proper 'X' location, the menu might/will popup in the wrong place (looking really crappy to boot!)
i guess what i'm basically asking is: how do i set a var to = whatever the current left column width is (+Y for the offset of the 'main' column).
basically, the center column *is* the site(kinda like yahoo). the left padding column is 'only' there to give a location/margin var. how do i get the menu script to read the left column amt.?
#5
Re: Quick Javascript Question
Posted 14 June 2002 - 10:24 AM
Oh!
Then I don't know.
Then I don't know.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote





|