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

好久不见. 提交于 2019-12-11 23:52:37

问题


I'm using JQM data-role="datebox" as following:

<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.


回答1:


You'll need to set the option "popupPosition" to "window".

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

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



回答2:


CSS may be the answer you seek. 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

Or there are many more CSS examples on that website.



来源:https://stackoverflow.com/questions/33605797/how-to-set-datebox-pop-to-the-center-of-window-in-jquery-mobile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!