作家
登录

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

作者: 来源:www.28hudong.com 2013-03-30 01:11:54 阅读 我要评论

复制代码 代码如下: $.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(); } 调用: 复制代码 代码如下: $(function(){   var d =$('<div id="d"></div>');   $('#d').hDialog({submit:function(){$(d).dialog('close');}}); })

  推荐阅读

  纯js实现背景图片切换效果代码

html代码 复制代码 代码如下: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <hea>>>详细阅读


本文标题:在次封装easyui-Dialog插件实现代码

地址:http://www.17bianji.com/kaifa2/JS/25448.html

关键词: 探索发现

乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

网友点评
自媒体专栏

评论

热度

精彩导读
栏目ID=71的表不存在(操作类型=0)