2012-05-09 13 views
0

私はダイアログボックスを使用していますが、サイズが正しくない場合は、それを変更する方法はありますか?ダイアログボックスのサイズを設定してください

 <script type="text/javascript"> 

    $.ajaxSetup({ cache: false }); 

    $(document).ready(function() { 
     $(".openDialog").live("click", function (e) { 
      e.preventDefault(); 


      $("<div></div>") 
       .addClass("dialog") 
       .attr("id", $(this) 
       .attr("data-dialog-id")) 
       .appendTo("body") 
       .dialog({ 
        title: $(this).attr("data-dialog-title"), 
        close: function() { $(this).remove() }, 

        modal: true 
       }) 

       .load(this.href); 
     }); 

     $(".close").live("click", function (e) { 
      e.preventDefault(); 
      $(this).closest(".dialog").dialog("close"); 
     }); 
    }); 
</script> 

答えて

2

jqueryのドキュメントからは、ピクセル単位でwidthheight

http://docs.jquery.com/UI/Dialog

ダイアログの高さを、使用することができます。 'auto'を指定すると、内容に基づいてダイアログを調整するために がサポートされます。ピクセル

.dialog({height: 

ダイアログの幅、。

.dialog({height: 

$.ajaxSetup({ cache: false }); 

$(document).ready(function() { 
    $(".openDialog").live("click", function (e) { 
     e.preventDefault(); 


     $("<div></div>") 
      .addClass("dialog") 
      .attr("id", $(this) 
      .attr("data-dialog-id")) 
      .appendTo("body") 
      .dialog({ 
       width:yourValueHere,//Put width 
       height:yourValueHere,//Put height 
       title: $(this).attr("data-dialog-title"), 
       close: function() { $(this).remove() }, 

       modal: true 
      }) 
関連する問題