jQuery datepicker和fullcalendar,datepicker没有显示

时间:2014-05-23 16:33:37

标签: jquery datepicker fullcalendar

当我将datepicker组件和fullcalendar组件包含到布局文件中时, datepicker不是真的。但是,每个页面都是一个接一个地正常工作。 plae帮助我。 代码在这里: 的 Calendar.jsp

<html>
<head>
<title>calendar</title>
<link rel='stylesheet' type='text/css' href='http://arshaw.com/css/main.css?6' />
<link rel='stylesheet' type='text/css' href='http://arshaw.com/css/fullcalendar.css?3' />
<link rel='stylesheet' type='text/css' href="fullcalendar.css" />
<script type='text/javascript' src='http://arshaw.com/js/fullcalendar-1.6.3/jquery/jquery-1.10.2.min.js'></script>
<script type='text/javascript' src='http://arshaw.com/js/fullcalendar-1.6.3/jquery/jquery-ui-1.10.3.custom.min.js'></script>
<script type='text/javascript' src='http://arshaw.com/js/fullcalendar-1.6.3/fullcalendar/fullcalendar.min.js'></script>
<script>
$(function() {

        $('#calendar').fullCalendar({
                                    //
                    });
</script>

日期选择器

<script type='text/javascript'>
$(function() {

    $( "#datepicker" ).datepicker();

    $( "#datepicker" ).datepicker( "option", "dateFormat","yy-mm-dd");

    $.datepicker.regional['ko'] = {
               ...
             };
                 $.datepicker.setDefaults($.datepicker.regional['ko']);
 });
</script>

layout.jsp

<html>
<head>
<title>Insert title here</title>
</head>
<body>
<table border="1">
<!-- datepicker input text part -->
<tr height="300px"><td><%@ include file = "./datepicker.jsp" %></td></tr>

<!-- Jquery fullcalendar part -->
<tr><td><%@ include file = "./Calendar.jsp" %></td></tr>
</table>
</body>
</html>

1 个答案:

答案 0 :(得分:0)

您似乎在JS中添加了Calendar.jsp个文件,但在datepicker中找到Layout.jsp,因此加载Calendar.jsp时,它不会了解datepicker的位置。

尝试将JS和CSS文件的所有内容移至Layout.jsp

我把这个小提琴放在一起似乎有效:

http://jsfiddle.net/2faxr/