[英]How do I set a wpf text box to resize automatically when the user changes the size of dialog box?
[英]Set size on Dialog box
我正在使用一個對話框,但它的大小不正確有沒有辦法改變它?
<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>
從jquery文檔中,您可以使用width
和height
http://docs.jquery.com/UI/Dialog
對話框的高度,以像素為單位。 還支持指定“自動”以使對話框根據其內容進行調整。
.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
})
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.