DHTML: div animation

B

brianwmunz

I don't need to do anything complicated. All I want to do is to have a
div slide down from underneath a button I have. When i search online,
I find a zillion slide down menu scripts, but they don't work for just
sliding a div.
Can someone please point me in the right direction?
Thanks.
 
S

scottstirling

I've done this in a cross-browser way. If you mean slide down the way I
think, you need to user the timer functionality in Javascript, with a
loop and a pause time to slow down the positioning of the div. Look for
something that does that and simplify it to your needs. Set the div to
invisible and position absolute at the outset (using CSS) -- it must be
absolute in order to set the z-index to greater than 1, which is
necessary to create the sliding div on top of the page, rather than
pushing the page down as it slides open, which is what happens when its
z-index 0 or 1. Use a user-initiated Javascript event, such as clicking
on or mousing over the button, to trigger the slide down function.

Scott Stirling
Framingham, MA
 
S

Shaffer

Well,
You could do it really simple with DHTML like so:

1. Make a div and assign it styles and content.
Remember, it must be under the div of the hover-object. This issue gets
more complicated, I may just post the full answer by your request.
<div id="dropDownMenu" style="position: relative; top: pixles from top;
left: pixles from left; visibility: hidden; border-color: black; and
many more styles which I can help you with">Link1<br /><hr /><br
/>Link2<br /><hr /><br />Link3</div>

2. Create a hover-object, another object of your drop-down menu.
This will be going above the drop-down menu.
<div id="hoverObject"
onmouseover="dropDownMenu.style.visibility='visible'">Put the mouse
over me!</div>


That's about it, I did not test it so there may be mistakes. Just
E-mail me if you need more help or want me to complete the drop-down
menu.

Omri Shaffer.
 
S

Shaffer

Sorry for spam but the z-index option sounds cool eventhough they
should both work the same.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top