2012-05-31 125 views
3

嗨,我想改變對話框的文字大小。動態地,我創建了th對話框,我需要改變文字大小。怎麼做?請引導我。如何更改jquery中的對話框文字大小

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 
      } 

回答

3

您可以使用.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 
} 
+0

我懷疑papaitians – user1324068

1

在您的樣式表,你可以爲整個對話的字體和/或該域內的元素:

<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屬性,就像我上面例子的最後一行所示。

相關問題