writing modal pop-up with jQuery -


I am trying to understand how the modal windows work. I know, there are many plug-ins, but I would like to write my own - a simple one

- I can add a JPEG function () hidden layer when some elements are clicked on the page is.

- I can load it above the contents of the page, but tweaking CSS, but I still can not believe how to do two things.

For example, how do I tuck the rest of the page under the window?

Thank you.

You have to use the second layer between the model content and the rest of the page. It is usually called an overlay, the color of the overlay is black or white (normally) and is slightly opaque.

For best results set

  body, html {width: 100%; Height: 100%}   

so the overlay will not be restricted by the size of body / html

  div.overlay {width: 100%; Height: 100%; Status: fixed; Top: 0; Left: 0; Z-index: 12000}   

Then add overlay:

  var overlay = $ ('

If you start running into problems, then in older browsers like IE 6, which shows a dropdown list at the top of the z-index controlled elements. For this, you have to use hidden IFrame technology under content.

Comments