2012-07-23 19 views
1

我使用jQuery 1.7.2和jqm-datebox'stable'。jquery mobile - datebox左邊顯示太多

代碼:

<label class="ui-input-text ui-hidden-accessible" for="date">Date</label> 
<input jql id="date" class="ui-input-text ui-body-c ui-corner-all ui-shadow-inset" type="text" value="" name="date" data-role="datebox" data-options='{"mode": "calbox", "calStartDay": 1}'></input> 

當我點擊小圖標,不過,日曆框出現太多的左邊,如圖片。這在移動設備上尤其明顯。

如果我減小窗口的寬度,它會進一步離開。 element.style(特別是left屬性)看起來是根據寬度計算的,但我無法找到哪裏,既不在css中,也不在js中。 我看到this question,有點類似於我的,但我不覺得它適用於我的情況。

我應該如何使整個盒子顯示?

calendar box goes out of the page

+0

給'centerHoriz':真正的拍攝(添加到選項) – 2012-07-30 05:38:59

+0

對不起,沒有看到這個。我現在正在度假,當我回到辦公室時會試試!會讓你知道,謝謝! :) – Stephan 2012-08-01 20:16:44

+0

好吧,我試過了。它的工作原理是它在文本框的下方水平居中,但這樣它仍然不在窗口之外。任何其他想法?我通過選項列表檢查,但沒有'alignRight'或類似的。 – Stephan 2012-08-14 09:35:27

回答

1

從文檔:

<input name="mydate" id="mydate" type="date" data-role="datebox" data-options='{"mode":"calbox", "centerHoriz": true}'> 

的centerHoriz選項會得到你想要的東西。

+0

你的意思是像7月發佈的JTSage? – 2012-11-13 20:29:10

+0

我第二@OlleSjögren的評論。正如我所說,它對我而言也不起作用。 – Stephan 2012-11-14 08:45:13