2012-08-09 107 views
0
同一頁面

我對重複的問題道歉,但問題是「封閉」,我有新的信息。日期選擇器的多個實例

的問題是,我有兩個日期選取器,當你點擊一個日曆工作正常,但然後單擊其他,並沒有上來,除非你點擊頁面上的其他地方,然後返回。

這是對jsfiddle.net測試和錯誤是不可複製的,但我複製的bug什麼也沒有,但下面的代碼:

<html> 
<head> 
<script type="text/javascript" src="jquery-1.7.2.js"></script> 
<script type="text/javascript" src="jquery.ui.core.js"></script> 
<script type="text/javascript" src="jquery.ui.datepicker.js"></script> 
<script type="text/javascript"> 
$(document).ready(function(){ 
    $("#frompicker").datepicker(); 
    $("#topicker").datepicker(); 
}); 
</script> 
</head> 
<body> 
<input id="frompicker" class="dp" type="text"> 
<input id="topicker" class="dp" type="text"> 
</body> 
+0

我檢查了我的jQuery和jquery.ui的版本。 jQuery是1.7.2(我也有1.7嘗試過),並具有的.ui 2012年版權我測試這兩個Firefox和Chrome。 – gavin 2012-08-09 16:16:43

+0

它工作得很好,對我來說。 – Mohayemin 2012-08-09 18:11:51

回答

0

完美的作品,http://jsbin.com/ajapih/1/edit#html,live

確保您<script ... src="jquery-whatever-files.js"是在正確的地方。你有它的方式,他們應該在同一文件夾中的HTML文件。同時打開你的螢火蟲控制檯並檢查javascript錯誤。

2

我發現這工作得很好:

$(document).ready(function(){ 
    $(".dp").datepicker(); 
}); 

<input id="frompicker" class="dp" type="text"> 
<input id="topicker" class="dp" type="text"> 

使用類調用的函數。只記得給他們不同的名字來獲取值

相關問題