Riva:
CSS properties would be found in an object's "style" property. The
JavaScript names are the same usually as the CSS names, only the
JavaScript equivalent of hyphenated names is to remove the hyphen and
capitalise the second word. The values you give them are the same as the
CSS values
For example...
obj.style.display = "block" is the same as display: block
obj.style.marginTop = "10px" is the same as margin-top: 10px
I had a look at the link you gave and couldn't see what you were
referring to I'm afraid. From what I gather from your post though you
want the form to move up and down depending on whether or not a menu
dropdown is visible or not.
Personally, instead of setting the CSS top property of the form
(presumably that's what you're thinking) I'd just write your HTML to
have your menu dropdowns as block elements inside your document flow
(i.e. not position:absolute which makes them floaty layers over the top
of everything else) and then use display:block or display:none to switch
them on and off - the document flow will change depending on if the menu
is physically rendered or not and the browser will shunt the form up and
down accordingly.
Dead rough example:
<p id="para1">This is a paragraph</p>
<p id="para2">So is this</p>
<form>
<input type="text" value="This is a text box" />
</form>
If you set the second paragraph's display CSS to "none" it will
physically not render which will shunt the form up a bit underneath
paragraph 1. If you then set paragraph 2's display back to "block" it
will render and the form will shunt back down again.
Have a look at http://thenvqcentre.co.uk/funding.php (it's not quite
finished yet so watch out for weird floating) and select you want to
train for NVQ Level 2 (allow pop-ups for this one if you have to).
You'll see how the yes | no block shunts down every time a new question
is confirmed, as do the end messages.
Is that the sort of thing you're talking about, only being able to shunt
upwards too?
MOU
Portman wrote:
Hi all,
I was wondering if it is possible to find out the value of a css
property (using JavaScript) and then change it? For example, I have a
form under a drop down menu. The client wants the form to move down as
the menu expands. I made the drop down menu using jQuery and I have
figured out how to get the form to drop when the menu opens, but I
cannot figure out how to get the form to move back up again, or drop a
different amount depending on which link in the drop down menu the
user clicks. Does that make sense? The page is here:
http://www.legacyfoundation1.org.
TIA,
Riva
____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
Send Your Posts To: wdvltalk@lists.wdvl.com
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk
________________ http://www.wdvl.com _______________________
You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016
Please include the email address which you have been contacted with.