Topic: Just slide a div (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: New Jersey, USA |
posted 04-11-2006 21:25
I have a div that gets displayed inline when a function is called and is then set to display=none after a given amount of time. My boss wants me to find a way to have the div slide in instead of just showing up. Just for clarity sake, when the div slides in, it needs to slide in from the top of the page (oof screen) and and push the rest of the content down as it does so. This doesn't seem like it should be a big deal, but I don't seem to be able to find a beginner type article or tutorial to read to get me started on moving a div a pixel or 2 at a time so it looks to be sliding. |
Bipolar (III) Inmate From: Sweden |
posted 04-11-2006 21:42
A simple way to move a div and then hide it would be to create a function like this: code: function moveDiv(id){ var div=document.getElementById(id) var newpos=parseInt(div.style.top)+2+"px" if(newpos<600){ // Here you put the value it should move to setTimeout("moveDiv("+id+")",100) // Tweak the time to get a smooth movement. } else{ setTimeout("functionToHideDiv()",1000) } }
|
Maniac (V) Inmate From: Sthlm, Sweden |
posted 04-11-2006 22:00
take a look here, http://www.dmsproject.com/test/team24/projprocess.html a lot o slidin 'n hidin goin on |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 04-11-2006 23:35
Sweet |
Maniac (V) Inmate From: Boston, MA, USA |
posted 04-12-2006 03:50
Here are some AJAX-y links. You probably know them already but just in case: |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 04-12-2006 19:29
Steve |
Maniac (V) Inmate From: raht cheah |
posted 04-12-2006 19:49 |
Maniac (V) Inmate From: Boston, MA, USA |
posted 04-13-2006 15:02
Only one thought comes to mind, and it might be a long shot. Flash has a "wmode" parameter. This is often used to enable dHTML menu items to render on top of a Flash movie (which otherwise defaults to a z index above everything else), but it might help in this case. The wmode "opaque" is said to be less processor intensive than "transparent". |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 04-13-2006 18:15
I messed with the wmode parameter but it had no effect on the flicker in Firefox. On the other hand, I am having problems with flash's z-index in other places trying to get elements to display above a flash, so I will look into it from that perspective now. I have to say though that in my googling efforts on wmode before there's not a lot of indepth info on it out there. |
Maniac (V) Inmate From: Boston, MA, USA |
posted 04-13-2006 18:52
wmode opaque will definitely help with the z index. Sorry it didn't hep the FireFox flicker issue. |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 04-14-2006 03:27
Thanks Steve |
Maniac (V) Inmate From: Boston, MA, USA |
posted 04-14-2006 04:37
Hmmm. |