源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

在次封装easyui-Dialog插件实现代码

  • 时间:2021-05-26 06:09 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:在次封装easyui-Dialog插件实现代码
[u]复制代码[/u] 代码如下:
$.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 id="' + id + '_content" style="padding:5px;"></div>'); $('#' + id + "_content").html(options.html); } createContent(); }
调用:
[u]复制代码[/u] 代码如下:
$(function(){   var d =$('<div id="d"></div>');   $('#d').hDialog({submit:function(){$(d).dialog('close');}}); })
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部