【发布时间】:2015-01-09 07:26:46
【问题描述】:
我是 Kendo Window 的新手,我计划将 window.resize() 函数声明为页面中所有 Kendo Windows 的全局 jquery 函数。我该如何申报?
我在下面的 .js 文件中添加了这段代码,并在 _Layout.cshtml 中引用了它,但它不起作用:
$(window).resize(function() {
$(".k-window").kendoWindow().center();
});
单独使用时,我使用的是这组代码:
var modal = $("#mdlWindow").kendoWindow({
visible: false,
resizable: true,
modal: true,
content: "../Position/Info,
width: "50%",
height: "50%",
maxWidth: 500,
maxHeight: 600,
minWidth: 300,
minHeight: 400,
top: 0,
bottom: 0,
left: 0,
right: 0,
iframe: true
}).data("kendoWindow");
modal.center().open();
$(window).resize(function() {
modal.center();
});
接受任何建议。如果有办法在 css 中做到这一点,我会尝试。
【问题讨论】:
标签: javascript c# jquery css kendo-ui