简体   繁体   English

如何在JQuery Mobile中将日期框弹出设置为窗口的中心?

[英]How to set datebox pop to the center of window in JQuery Mobile?

I'm using JQM data-role="datebox" as following: 我正在使用JQM data-role="datebox" ,如下所示:

<input name="startTime" id="startTime" type="text" data-role="datebox" data-options={"mode": "datebox"}>

But it always pop up at the left side of window. 但是它总是在窗口左侧弹出。
Is there any way to make it pop up to the center of window? 有什么办法可以使其弹出到窗口中心?
Thanks. 谢谢。

You'll need to set the option "popupPosition" to "window". 您需要将选项“ popupPosition”设置为“ window”。

http://dev.jtsage.com/DateBox/api/popupPosition/ http://dev.jtsage.com/DateBox/api/popupPosition/

<input name="startTime" id="startTime" type="text" data-role="datebox" data-options='{"popupPosition": "window", "mode": "datebox"}'>

CSS may be the answer you seek. CSS可能是您寻求的答案。 You can attach a style to this to position and format the datebox. 您可以为此添加样式,以定位和格式化日期框。

Like this for example: http://www.w3schools.com/css/css_align.asp 例如: http//www.w3schools.com/css/css_align.asp

Or there are many more CSS examples on that website. 或者该网站上还有更多CSS示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM