looking for a very simple implementation of modal dialog box without using jquery UI.
just for example
<div class="modal" id="something" style="display: none;">
<div class "titlebar">
<h4>title</hr>
<a href="#" >xx</a>
</div>
<div class=content></div>
<div class=footer></div>
</div>
When user click on the button I want to show dialog and close when user pres 'xx'. I saw some example but it has many extras. I am looking for somethig like click of button show dialog it shoud stay there till user clicks on 'x' no jqueryui.
any simple example will be great.
Here's a very basic version:
Live example
How it works:
#f0f0f0
and opacity is 50%) so it "greys out" the underlying document. This is absolutely positioned at 0,0 with 100% width and height, and a z-index of 100 (this has to be higher than anything else on the page). Thesrc
of the iframe should be a blank document.Now, there are a lot of variations. For instance, there's no reason at all you can't have the model div markup in the HTML document rather than in the script — -- just give it
display: none
until you need it. Things like that.Obviously, this version lets you click anywhere on the dialog box to dismiss it, but it's easily modified to only allow closing with an [X] somewhere. And to say that it could use some styling would be to...put it mildly.
All that said, I can't claim it's remotely bulletproof. That's why well-tested plug-ins are for. :-)
I think you're looking for something like this: