javascriptjquery-mobiledatebox

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


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.


Solution

  • 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"}'>