Tutorial Request: Drop-In Windows?

S

Steve

Can anyone recommend a tutorial for how to make a drop-in window?

First do I have the right name? What I am referring to is an
alternative to a pop-up box. It is basically a DIV that gets
dynamically displayed so that a rectangle gets laid over the content,
usually with a message inside, until the user clicks "ok" to make it
go away.

I would like to learn how to do this and:

- lock all of the HTML form elements on the screen while this is
happening
- gray out or darken the colors of the screen while the drop-in window
displays
- put buttons or input fields into the dorp-in window and see an
example of collecting
information from the drop-in window

I've seen some simple examples on the web, but I would like a tutorial
that explains all of the pieces.

Thanks much in advance for any info
 
S

SAM

Steve a écrit :
Can anyone recommend a tutorial for how to make a drop-in window?

I would like to learn how to do this and:

- lock all of the HTML form elements on the screen while this is
happening
- gray out or darken the colors of the screen while the drop-in window
displays

<html>
<button onclick="document.getElementById('hidder').style.display='block';">
hide</button>
<div id="hidder"
style="display:none;height:100%;width:100%;position:absolute;top:0;
background:black;color:white;filter:alpha(opacity=50);
-moz-opacity:0.5;-khtml-opacity:0.5;opacity:0.5;"
onclick="this.style.display='none';">click to close me</div>
- put buttons or input fields into the dorp-in window and see an
example of collecting
information from the drop-in window

<form action="#" id="hidder"
onsubmit="this.style.display='none';return false;">
<p>Name = <input name="Name"
onchange="if(this.value.length>0)document.forms[0][0].value=this.value">
<p>Firstname = <input name="First"
onchange="if(this.value.length>0)document.forms[0][1].value=this.value">
<p><input type=submit>
I've seen some simple examples on the web, but I would like a tutorial
that explains all of the pieces.

Most part of the purpose is made by CSS
- make a div positioned in absolute
- make this div to cover the viewport
with a background color and fix the opacity of this div

Put this div at the end of your html
(like that it will be in front of all what is in the page)

If you have only one form put it in this div

then reveal or hide this div.
show :
onclick="document.getElementById('hidder').style.display='block';"
hide :
onclick="document.getElementById('hidder').style.display='';"


Then the problem will to slide this div on the correct space
(if the page is higher than height of a small window, say about 550 px)
 

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,780
Messages
2,569,611
Members
45,273
Latest member
DamonShoem

Latest Threads

Top