欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

在次封裝easyui-Dialog插件實(shí)現(xiàn)代碼

 更新時間:2010年11月14日 19:26:43   作者:  
在次封裝easyui-Dialog插件實(shí)現(xiàn)代碼,需要的朋友可以參考下。
復(fù)制代碼 代碼如下:

$.fn.hDialog = function (options) {
var defaults = {
width: 300,
height: 200,
title: '此處標(biāo)題',
html: '',
iconCls: '',
submit: function () { alert('可執(zhí)行代碼.'); }
}
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 id="' + id + '_content" style="padding:5px;"></div>');
$('#' + id + "_content").html(options.html);
}
createContent();
}

調(diào)用:
復(fù)制代碼 代碼如下:

$(function(){
  var d =$('<div id="d"></div>');
  $('#d').hDialog({submit:function(){$(d).dialog('close');}});
})

相關(guān)文章

最新評論