$.fn.hDialog = function (options) {
        
var defaults = {
            width: 
300,
            height: 
200,
            title: 
'此处标题',
            html: 
'',
            iconCls: 
'',
            submit: 
function () { alert('可执行代码.'); }
        }
        
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: 
'确定',
                iconCls: 
'icon-ok',
                handler: options.submit
            }, {
                text: 
'取消',
                iconCls: 
'icon-cancel',
                handler: 
function () {
                    $(
'#' + id).dialog('close');
                }
            }]
        });

        
function createContent() {
            $(
'.dialog-content',$(self)).empty().append('<div >).html(options.html);
        }
        createContent();
    }

调用:

 

$(function(){
  var d =$('<div >);}});
})

 

 

 

 

相关文章:

  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-23
  • 2021-08-14
  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案