Creating a simple popup

This tutorial will guide you create a simple popup based on CSS and Javascript

1.  Create a simple div

HTML

<div id="overlayContent" style="display:none;z-index:110;width:100%;position:absolute;left:0;top:25;height:200px;"> </div>

here , make sure you put z-index to a value , display to none and position as absoulte.

2.  Write Open PopUP and Close PopUp in javascript

Javascript

// for popup Open
function popupwindowOpen()
{
document.getElementById('overlayContent').style.display = "block";

}
// for popup close
function popupwindowClose()
{
document.getElementById('overlayContent').style.display = "none";
}

That’s all………. this is a simple popup . you can add extra features to it..ex:apply CSS
and it will look good.

This entry was posted in Javascript and tagged , , . Bookmark the permalink.

One Response to Creating a simple popup

  1. Midhun Devasia says:

    Hello Sreejith nice post

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>