easyui dialog的一个小坑

640?wx_fmt=png&wxfrom=5&wx_lazy=1


问题描述:

1、html

<div id="dig" style="padding:10px;500px;height:300px;font-family:微软雅黑;font-size:16px;"> 

    Dialog Content. 

</div> 

2、js

$("#dig").css("display", "block");

$('#dig').dialog({

        title: "title",

        680,      

        closed: false,

        cache: false,

        modal: true,

        buttons: [          

            {

                text: '关闭',

                iconCls: 'icon-cancel',

                handler: function () {

                    $('#dig').dialog('close');

                }

            }]

    });

3、问题描述

首次打开弹窗 弹窗的div里面的style样式还在,第二次打开弹窗样式会丢失

4、避免的解决方案

尽量避免在弹窗的div上写样式,可以在套个div在里面写样式


原文地址:https://www.cnblogs.com/hgmyz/p/12352500.html