I have the following div:
<div id="divAlert">
<div id='divAlertText'>You must select a language.</div>
<div id='divAlertButton' class='btn blue' onclick="HideAlert();">Ok</div>
</div>
Is this HTML page there are more divs and buttons. I want to show divAlert
as a modal pop up.
I know there is something in jQuery, I think, that I can use to show my div with a half transparent black background filling the entire page. But I can't remember its name.
Any advice?
you can use jquery dialog widget
http://jqueryui.com/demos/dialog/
A simple modal pop up div or dialog box can be done by CSS properties and little bit of jQuery.The basic idea is simple:
So we need three divs:
First let us define the CSS:
It is important that we set our hider div's z-index lower than pop_up box as we want to show popup_box on top.
Here comes the java Script:
And finally the HTML:
I have used jquery-1.4.1.min.js www.jquery.com/download and tested the code in Firefox. Hope this helps.