【问题标题】:how to change the dialog text size in jquery如何在jquery中更改对话框文本大小
【发布时间】:2012-06-05 10:15:44
【问题描述】:

您好,我想更改对话框文本大小。我动态创建了对话框,我需要更改文本大小。如何执行此操作?请指导我。

function validate_email(){
                window.$required = $("#dialog").dialog({
                  width: 300,
                  height: 450,

                    autoOpen: false,
                           buttons: {
                'Complete': function() {
                   checkstatus(userid);
                }
              }
                });
            $required.html('Your account setup has been initiated. 
started.').dialog('open');//here my text
            }

【问题讨论】:

    标签: jquery dialog text-size


    【解决方案1】:

    您可以使用.css() 来修改对话框的样式:

    function validate_email(){
         window.$required = $("#dialog").dialog({
             width: 300,
             height: 450,
             autoOpen: false,
             buttons: {
                'Complete': function() {
                   checkstatus(userid);
                }
              }
         }).css("font-size", "20px");
    
         $required.html('Your account setup has been initiated. started.').dialog('open');//here my text
    }
    

    【讨论】:

      【解决方案2】:

      在您的样式表中,您可以为整个对话框和/或其中的元素设置字体:

      <style>
      #dialog { font-size: 25px; }
      #dialog h2 { font-size: larger; }
      #dialog div { font-size: 20px; }
      #dialog div.bigger { font-size: 150%; }
      #dialog p { font-size: x-small; background-color: blue; }
      </style>
      

      font-size property 接受许多不同的单位。

      当然你也可以用同样的方法设置其他的 CSS 属性,如我上面例子的最后一行所示。

      【讨论】:

        猜你喜欢
        • 2012-11-10
        • 2019-09-11
        • 1970-01-01
        • 1970-01-01
        • 2014-05-28
        • 2013-07-29
        • 2011-07-20
        • 1970-01-01
        • 2012-03-23
        相关资源
        最近更新 更多