我想顯示日期選擇器在第二個綠色,但日期選取器沒有出現,但在第一個綠色它會很好。我應該修改什麼?在小提琴第一次約會很好,但是當我點擊第二個文本框的綠色並沒有出現。它需要什麼類型的修改?日期選擇器沒有出現
這裏是小提琴
http://jsbin.com/unosar/8/edit#javascript,html,live
任何解決方案,請
我想顯示日期選擇器在第二個綠色,但日期選取器沒有出現,但在第一個綠色它會很好。我應該修改什麼?在小提琴第一次約會很好,但是當我點擊第二個文本框的綠色並沒有出現。它需要什麼類型的修改?日期選擇器沒有出現
這裏是小提琴
http://jsbin.com/unosar/8/edit#javascript,html,live
任何解決方案,請
您正在使用相同的ID爲2格,要麼改變類或使用唯一的ID,像
#invokeDP {
width: 20px;
height: 20px;
background: green;
display: inline-block;
}
#invokeDP2 {
width: 20px;
height: 20px;
background: green;
display: inline-block;
}
var dp = new DatePicker('.picker', {
pickerClass: 'datepicker ',
allowEmpty: true,
toggleElements: ['invokeDP', 'invokeDP2'] //2 divs with 2 unique ids
});
您的HTML無效:您不能使用兩次id
,id
屬性must be unique。
,這足以使它成爲一個類和所有將工作(見http://jsbin.com/unosar/19/edit#javascript,html,live)
此外,toggle_class可以是簡單的字符串,而不是隻有一個數組:http://www.monkeyphysics.com/mootools/script/2/datepicker#examples
順便說一句,你應該使用改爲官方改進mootools datepicker。
感謝sudhir bhaya ...它解決了這個問題:) – saroj