admin管理员组文章数量:1324876
I have an issue that the Kendo Window does not center correctly.
Here is a simple fiddle that demonstrates the issue. So there is room for the kendo window to show without the browser vertical scroll bar, but the kendo window center method, puts it off center, and forces the browsers scroll bar to appear.
Fiddle: /
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();
});
Please show me how I can get the kendo window to center correctly.
I have an issue that the Kendo Window does not center correctly.
Here is a simple fiddle that demonstrates the issue. So there is room for the kendo window to show without the browser vertical scroll bar, but the kendo window center method, puts it off center, and forces the browsers scroll bar to appear.
Fiddle: http://jsfiddle/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();
});
Please show me how I can get the kendo window to center correctly.
Share Improve this question asked May 20, 2014 at 11:35 user2109254user2109254 1,7593 gold badges33 silver badges53 bronze badges 2- Not understand what do you want. Window centered correctly, in center of preview. Explain in more details. – Magistr_AVSH Commented May 20, 2014 at 11:48
- Thanks for responding. Look at the picture in my question. The kendo window is not centred vertically as there is space above it, and because of that space it makes the vertical scroll bar appear in the browser, as seen in the picture. If the kendo window vertically centred correctly there would be less space at the top, and no vertical scroll bar in the browser. – user2109254 Commented May 20, 2014 at 11:56
1 Answer
Reset to default 8I think the problem is solved :) Try.
$(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
});
});
JSFiddle
本文标签: javascriptkendo ui window not centering correctlyStack Overflow
版权声明:本文标题:javascript - kendo ui window not centering correctly - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742135081a2422332.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论