Animating my dialog window

M

Mister Blood Rails

How can I animate this thing? I like it simple.

So far it can fade. But ultimately I'd like it like
http://www.e-magine.ro/playground/moodalbox/

function show_dialog() {
document.getElementById('shade').style.display = 'block';
document.getElementById('dialog').style.display = 'block';
fade_in();
}
function clear_dialog() {
document.getElementById('shade').style.display = 'none';
document.getElementById('dialog').style.display = 'none';
}
var opacity = 0
function fade_in() {
opacity += 0.3
if (opacity < 1) {
setTimeout('fade_in()', 1);
}
set_opacity();
}
function hide_dialog() {
opacity -= 0.3
if (opacity > 0) {
setTimeout('hide_dialog()', 1);
} else {
clear_dialog();
}
set_opacity();
}
function set_opacity() {
document.getElementById('dialog').style.opacity = opacity
document.getElementById('shade').style.opacity = opacity / 2
}

Much obliged,
Kyrre
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top