$.fn.hdialog = function (options) {
var defaults = {
WIDTH:300,
HEIGHT:200,
Title: ' Here's the headline ',
HTML: ',
Iconcls: ',
Submit:function () {alert (' executable code. ');}
}
var id = $ (this). attr (' id ');
options = $.extend (defaults, options);
var self = this;
$ (Self). Dialog ({
Title:options.title,
Height:options.height,
Width:options.width,
ICONCLS:OPTIONS.ICONCLS,
Buttons: [{
Text: ' OK ',
Iconcls: ' Icon-ok ',
Handler:options.submit
}, {
Text: ' Cancel ',
Iconcls: ' Icon-cancel ',
Handler:function () {
$ (' # ' + ID). dialog (' Close ');
}
}]
});
function Createcontent () {
$ ('. Dialog-content ', $ (self)). Empty (). Append (' <div id= ' + ID + ' _content ' style= "padding:5px;") ></div> ');
$ (' # ' + ID + ' _content '). HTML (options.html);
}
Createcontent ();
}
Call method
$ (function () {
var d =$ (' <div id= ' d ' ></div> ');
$ (' #d '). Hdialog ({submit:function () {$ (D). dialog (' Close ');});
})