问题
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