Dialog jQuery window dialog plugin
The simple jQuery Plugin for
customizable modal windows with custom buttons. Responsive,
lightweight, easy customizable modal window plugin
Source code on GitHub or
download (zip).
Fast, light, mobile-friendly and responsive lightbox and modal dialog plugin. Open plain text, HTML, any content, image, form, iframe (YouTube, Vimeo, Google Maps). Responsive work only through CSS rules.
This plugin helps you display modals, popups, and notices. For convenience, set up several similar js function: jAlert, jConfirm, jPrompt
<!-- this should go after your </body> -->
<link rel="stylesheet" type="text/css" href="/jquery.dialog.css"/>
<script src="/jquery.js"></script>
<script src="/jquery.dialog.js"></script>
Alert
Simple dialog analogue Alert
jAlert('Hello World!!!')
Confirm
Simple dialog analogue Confirm
jConfirm('Are you shure?', function() {
jAlert('You click "OK"')
}, 'Title')
Prompt
Simple dialog with input field analogue Prompt
jPrompt('Enter your name', function(e, value) {
jAlert('You name "'+value+'"')
})
Wait dialog
Dialog to display ajax progress or other load
jWait('Please wait')
Picture
Show gallery's item not modal
$('<img src="images/beautiful-eyes-wallpaper.png" alt="Open picture" title="Open picture" />')
.dialog({modal:false});
Youtube video
Dialog with movie from YouTube
jAlert('<iframe width="560" height="315" src="//www.youtube.com/embed/fk24PuBUUkQ" frameborder="0" allowfullscreen></iframe>');
Custom buttons
Dialog with custom buttons
var vimeo = '<iframe src="//player.vimeo.com/video/10848092" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
$(vimeo).dialog({
title: 'Vimeo video',
buttons:{
'Go to Vimeo': function () {
location = 'http://vimeo.com/10848092';
},
'Close': function() {
this.dialog('hide')
},
'Alert': function () {
jAlert("I'm fine");
return false;
},
'Any text':$('<a href="http://xdsoft.net">Custom button</a>') // custom button
}
})
Big data
jAlert('<iframe width="1024" height="6993" src="//en.wikipedia.org/wiki/JQuery" frameborder="0" allowfullscreen></iframe>');
Full options list
Name | default | Ex. |
---|---|---|
title | '' |
|
Title header for dialog window | ||
buttons | {} | |
Buttons list, plain object
|
||
closeFunction | fadeOut | |
jQuery method for hide dialog
|
||
showFunction | fadeIn | |
jQuery method for show dialog
|
||
closeBtn | true | |
Show close button in right top corner
|
||
closeBtn | true | |
Show close button in right top corner
|
||
closeOnClickOutside | true | |
Close window when user clicked on anywhere outside dialog window
|
||
closeOnEsc | true | |
Close window when user pressed Esc
|
||
clickDefaultButtonOnEnter | true | |
Start default button's handler when user pressed Enter
|
||
zIndex | 10 | |
How on this site too, zIndex for dialog may be less than any block on site. In
this case you can set big value for this option
|
||
modal | true | |
Open window without overlay
|
||
shown | true | |
After init, plugin will be shown automatically, if you want to hide dialog
before before you make certain that the action use shown:false
|
||
removeOnHide | true | |
When you close dialog window, it element will delete from DOM. If you don't
want this, do removeOnHide:false
|
||
hideGlobalScrollbar | true | |
How you could observe when dialog window opens, scrollbar for <body>
hides. Sometimes it can work wrongly
|
||
Methods |
||
resize | Use when window or content inside dialog (with modal:false) changed
|
|
ok | Fire default button handler
|
|
hide | Hide dialog window
|
|
show | Hide dialog window
|
|
title | Set title for dialog window
|
|
title | Set title for dialog window
|
|
content | Set content for dialog window
|
|
Helpers |
||
jAlert |
Simple function analogue «alert»
|
|
jConfirm |
Analogue «confirm» function
|
|
jPrompt |
Analogue «prompt» function
|
|
jWait |
Show waiting dialog
with_close - show close button
not_close_on_click - not close when user clicked outside dialog
|