use*_*254 3 javascript kendo-ui kendo-window
我有一个问题,剑道窗口没有正确居中.
这是一个简单的小提琴,演示了这个问题.因此,在没有浏览器垂直滚动条的情况下,kendo窗口可以显示空间,但是kendo窗口中心方法会将其置于中心位置,并强制浏览器滚动条显示.

小提琴: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>
Run Code Online (Sandbox Code Playgroud)
JavaScript的:
$(document).ready(function() {
var oWin = null;
$('#testWindow').kendoWindow();
oWin = $('#testWindow').data('kendoWindow');
oWin.center();
});
Run Code Online (Sandbox Code Playgroud)
请告诉我如何让kendo窗口正确居中.
我认为问题解决了:)试试.
$(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
});
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3706 次 |
| 最近记录: |