gpt4 book ai didi

javascript - 日历不适用于 jQuery 1.9.1(但它适用于 jQuery 1.7.1)

转载 作者:行者123 更新时间:2023-11-30 12:54:59 25 4
gpt4 key购买 nike

我有以下用于从下拉列表中选择日历日的脚本:

http://jsfiddle.net/nachosarmiento/XPj58/3/

$(document).ready(function () {

var calendario = new Date();
var una_noche = new Date();
var dos_noches = (new Date()).setDate(una_noche.getDate() + 1);
var tres_noches = (new Date()).setDate(una_noche.getDate() + 2);
var cuatro_noches = (new Date()).setDate(una_noche.getDate() + 3);
var cinco_noches = (new Date()).setDate(una_noche.getDate() + 4);
var atras = (new Date()).setDate(una_noche.getDate() - 1);

var dates;

var dates_in_string = '';

$('#simpliest-usage').multiDatesPicker({
disabled: true,
addDates: [una_noche]
});

$("#dias").on("change", function () {

$('#simpliest-usage').multiDatesPicker('resetDates', 'picked');
$('#simpliest-usage').multiDatesPicker('resetDates', 'disabled');


if ($("#dias").val() == "1") {
$('#simpliest-usage').multiDatesPicker({
disabled: true,
addDates: [una_noche]
});

dates = $('#simpliest-usage').multiDatesPicker('getDates');
dates_in_string = '';

for (var a in dates) dates_in_string += dates[a] + ' ';
alert(dates_in_string);

}

if ($("#dias").val() == "2") {
$('#simpliest-usage').multiDatesPicker({
disabled: true,
addDates: [una_noche, dos_noches]
});

dates = $('#simpliest-usage').multiDatesPicker('getDates');
dates_in_string = '';

for (var b in dates) dates_in_string += dates[b] + ' ';
alert(dates_in_string);

}

if ($("#dias").val() == "3") {
$('#simpliest-usage').multiDatesPicker({
addDates: [una_noche, dos_noches, tres_noches],
minDate: "una_noche"
});

dates = $('#simpliest-usage').multiDatesPicker('getDates');
dates_in_string = '';

for (var c in dates) dates_in_string += dates[c] + ' ';
alert(dates_in_string);

}

if ($("#dias").val() == "4") {
$('#simpliest-usage').multiDatesPicker({
addDates: [una_noche, dos_noches, tres_noches, cuatro_noches],
minDate: "una_noche"
});

dates = $('#simpliest-usage').multiDatesPicker('getDates');
dates_in_string = '';

for (var d in dates) dates_in_string += dates[d] + ' ';
alert(dates_in_string);

}

if ($("#dias").val() == "5") {
$('#simpliest-usage').multiDatesPicker({
addDates: [una_noche, dos_noches, tres_noches, cuatro_noches, cinco_noches],
minDate: "una_noche"
});

dates = $('#simpliest-usage').multiDatesPicker('getDates');
dates_in_string = '';

for (var e in dates) dates_in_string += dates[e] + ' ';
alert(dates_in_string);

}

});

});

它与 jQuery 1.7.2 完美配合,但当我想使用 jQuery 1.9.1 时停止工作。

有人知道这个问题的原因吗?

PD:官方网站:http://multidatespickr.sourceforge.net/

谢谢。

问候。

最佳答案

jQuery 1.9 删除了 $.browser 对象。

参见 this page about the jQuery "Migrate" plugin.

关于javascript - 日历不适用于 jQuery 1.9.1(但它适用于 jQuery 1.7.1),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19527491/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com