0
我有一個剃刀局部視圖,其中包含一個引導面板。它使用jquery在模態窗口中加載。在設計中,視圖應該具有始終可見的標題和頁腳部分,並且主體部分應該是可滾動的。我能夠通過將div class = panel-body的高度設置爲例如400px來實現此目的,但我希望在模式打開之前將其設置爲jquery,並將其設置爲根據模式高度確定的值窗口,我知道如何得到它。我的問題是如何將它應用到body部分,動態使用jquery?或換句話說:如何檢測何時加載此特定視圖?需要知道,使用jquery時,加載剃鬚刀視圖
RoomingList.cshtml
<div id="panelRoomingList" class="panel panel-primary nopadding">
<div class="panel-heading">
</div>
<div id="panelBody" class="panel-body" style="height:400px; overflow-y:scroll">
</div>
<div class="panel-footer text-center" style="margin-top:30px;">
</div>
</div>
重要提示:只有ilustration僞腳本。 爲簡化起見縮短了,請忽略任何代碼錯誤(如有)。原始作品如預期。
function ShowRoomingList() {
$.ajax({
url: ShowRoomingListUrl,
type: "GET",
cache: false,
success: function() {
$("#modal_RoomingList").modal("show");
$("#modal_RoomingList").html(data);
}
},
error: function (xhr, status, exception) {
DisplayAjaxError(xhr, status, exception); }
});
}
你可以知道這個負載正在加載到ajax調用權的'success'函數中嗎? – ramiramilu