1
Bu, gerçek içeriktir. Aşağıdaki kod, UI'de iki kez açılana bir değer ekledi. "AprilApril" yerine "Nisan"Jquery'de değeri ayarlayın, iki kez aynı değeri ekleyin
if ($('#dk_container_selectToYear .dk_options li.dk_option_current a').text() == 2016) {
var currentdate = new Date();
var month = currentdate.getMonth();
var monthname = monthLookup[currentdate.getMonth()];
month = month + 3;
while (month <= 13) {
$('#dk_container_selectToMonth .dk_options li:nth-child(' + month + ')').css({ "display": 'none' });
var listvalue = $('#dk_container_selectToMonth .dk_options li:nth-child(' + month + ')').text();
if ($('#dk_container_selectToMonth .dk_options li.dk_option_current a').text() == listvalue) {
$('#selectToMonth').dropkick('reset');
$('#selectToMonth').dropkick('setValue', monthname);
}
month++;
}
}
$('#selectToMonth').dropkick('setValue', monthname);
bunu önlemek için diğer seçeneği var mı olarak açılan değerini .. önceden
Teşekkür ..
monthLookup nasıl görünüyor? – Coss
, "monthname" öğesini ayarladıktan sonra kaydettirirseniz, ne görüyorsunuz? –