![](/img/trans.png)
[英]How to set datebox pop to the center of window in JQuery Mobile?
[英]How to programmatically set DurationBox value in jQuery Mobile DateBox2?
我在我的jQuery Mobile網頁上使用DateBox2插件。
我從JSON Web服務獲得以秒為單位的持續時間,該持續時間可以長達數天(例如86400s)。
我想使用標准的DateBox2持續時間顯示將其發布到我的文本輸入中,例如“ 1 Day,00:00:00”,但是我得到的只是普通的秒值。
我嘗試了.val()、. datebox(“ setTheDate”,86400)、. datebox(callFormat,...)的某些組合,但它們似乎都不起作用。
這是我的輸入字段:
<input class='period' type='text' readonly='readonly' data-role='datebox' data-options='{"mode": "durationbox", "showInitialValue": true, "useFocus": true}' />
提前致謝!
請使用這個:
$('element')。trigger('datebox',{'method':'dooffset','type':'s','amount':86400})。trigger('datebox',{'method':' doset'});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.