我试图用jquery-ui-1.8.17显示和设置12个月日期选择日历。 在Styling the jQueryUI DatePicker的帮助下,日历最初显示正常,即它显示了3行中的完整年份,每行包含4个月。 但是,当我点击日历中的一天时,显示器跳转到包含12个月的1行! 任何人看到这种奇怪的行为也有或有解决办法?jQueryUI DatePicker在日期点击12个月查看“跳转”
注意:在我的代码中,我包含了jquery-ui-1.8.17.custom.css。这是与http://jqueryui.com/themeroller生成的文件。请参阅css文件中的链接。
下面是完整的代码
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" media="screen" href="http://www.j2u.nl/jquery-ui-1.8.17.custom.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/jquery-ui.min.js" type="text/javascript"></script>
<script src="http://jquery-ui.googlecode.com/svn-history/r3982/trunk/ui/i18n/jquery.ui.datepicker-nl.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
$(".datepicker").datepicker ({
dateFormat: 'dd-MM-yy',
firstDay: 1, // rows starts on Monday
minDate: new Date(),
maxDate: '+1Y',
numberOfMonths: 12
});
$(".ui-datepicker-inline").width("850px");
$(".ui-widget").css("font-size","0.9em");
});
</script>
</head>
<body>
<p><div class="datepicker"></div></p>
</body>
</html>
请张贴一个例子或你的代码的其余部分,包括CSS。我抛出了你在jsFiddle上发布的内容并获得了一个长长的几个月。 – j08691 2012-04-17 20:33:31
现在添加完整的代码!另外作为一个小提琴:http://jsfiddle.net/r7pEe/ – rwijngaa 2012-04-18 17:01:46