Response title
This is preview!
<
script
>
$(
function
() {
$(
"#dialog"
).dialog();
});
</
script
>
<
div
id
=
"dialog"
title
=
"Basic dialog"
>
<
p
>
This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.
</
p
>
</
div
So here can I let my content editors just create the div, its id, title, and content and not have to create a function each time?
$(
"#"+id
).dialog();
}<
<
script
>
$(
function
() {
$(
"#dialog"
).dialog();
//I want to avoid having to have #dialog, #dialog2, #dialog3 etc. and just have this function once at the top of our page templates.
});
</
script
>
$( ".dialog-content" ).dialog( { /* the standard options for any given dialog */ } );
Thank you, but wouldn't that cause all dialogs to open at the same time? How could I avoid the below?
$( "#opener" ).click(function() {$( "#dialog" ).dialog( "open" );
});
$( "#opener2" ).click(function() {
$( "#dialog2" ).dialog( "open" );
});
$( "#opener3" ).click(function() {
$( "#dialog3" ).dialog( "open" );
});
How would I fix this problem above?
© 2013 jQuery Foundation
Sponsored by and others.