我有一个问题,Kendo 窗口没有正确居中。
这是一个演示问题的简单 fiddle 。所以在没有浏览器垂直滚动条的情况下,kendo 窗口有显示的空间,但是 kendo 窗口居中方法,将其偏离中心,并强制浏览器滚动条出现。
fiddle :http://jsfiddle.net/codeowl/QKPN6/2/
HTML:
<div id="testWindow">
<p>here is the test content here is the test content</p>
<p>here is the test content here is the test content</p>
<p>here is the test content here is the test content</p>
<p>here is the test content here is the test content</p>
<p>here is the test content here is the test content</p>
<p>here is the test content here is the test content</p>
<p>here is the test content here is the test content</p>
<p>here is the test content here is the test content</p>
<p>here is the test content here is the test content</p>
<p>here is the test content here is the test content</p>
<p>here is the test content here is the test content</p>
<p>here is the test content here is the test content</p>
<p>here is the test content here is the test content</p>
</div>
JavaScript:
$(document).ready(function() {
var oWin = null;
$('#testWindow').kendoWindow();
oWin = $('#testWindow').data('kendoWindow');
oWin.center();
});
请告诉我如何让剑道窗口正确居中。
最佳答案
我认为问题已经解决了:)试试。
$(document).ready(function() {
var oWin = null;
var h = window.innerHeight;
$('#testWindow').kendoWindow({});
oWin = $('#testWindow').data('kendoWindow');
oWin.center().open();
$('#testWindow').closest(".k-window").css({
top: h/2 - $('#testWindow').parent()[0].scrollHeight/2
});
});
关于javascript - kendo ui 窗口没有正确居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23758731/