zoukankan      html  css  js  c++  java
  • 在次封装easyuiDialog 插件

    $.fn.hDialog = function (options) {
            
    var defaults = {
                 
    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,
                 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');}});
    })
  • 相关阅读:
    iOS下WebRTC音视频通话(二)-局域网内音视频通话
    Android初级教程短信防火墙
    iOS下WebRTC音视频通话(一)
    Android初级教程IP拨号器初识广播接受者
    Delphi常用字符串函数
    fastreport对象的属性和方法
    字段名、字段数不确定时,用 FastReport 动态生成报表
    动态创建Fastreport
    html 的 ContentType 小结
    ASP页面显示乱码解决方法/ASP设置编码
  • 原文地址:https://www.cnblogs.com/hxling/p/1875542.html
Copyright © 2011-2022 走看看