【发布时间】:2015-09-27 20:26:56
【问题描述】:
我对 jQuery 还是很陌生。我有一个带有一些日期选择器日历的表单,但是当单击日历字段时,实际日历不会显示在该字段旁边。相反,它出现在我页面的顶部。谁能发现为什么会这样?谢谢。
$("#datepicker6").datepicker({
inline: true,
showOtherMonths: true,
dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
});
$("#datepicker7").datepicker({
inline: true,
showOtherMonths: true,
dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
});
.ui-datepicker {
border-radius: 1px;
background-color: #ffffff;
}
#datepicker-inline {
display: inline-block;
margin: 1% auto;
}
.ui-datepicker-header {
border-radius: 1px;
background: #ffffff;
}
.ui-datepicker-prev,
.ui-datepicker-next {
border-radius: 1px;
}
.ui-datepicker thead {
background-color: #ffffff;
border-radius: 1px;
}
.ui-datepicker th {
text-transform: uppercase;
font-size: 8pt;
}
.ui-datepicker td span,
.ui-datepicker td a {
font-weight: bold;
text-align: center;
width: 32px;
height: 32px;
line-height: 32px;
}
.ui-datepicker-calendar .ui-state-default {
background: #ededed;
}
.ui-datepicker-unselectable .ui-state-default {
background: #f4f4f4;
color: #b4b3b3;
}
.ui-datepicker-calendar .ui-state-hover {
background: #f7f7f7;
}
.ui-datepicker-calendar .ui-state-active {
background: #6eafbf;
color: #e0e0e0;
border: 1px solid #55838f;
position: relative;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.3/jquery-ui.min.js"></script>
<div id='UIItem20' style="display: inline-block">
What is the estimated deployment start date?
<br>
<br>
<input type="text" id="datepicker6">
<br>
<br>
</div>
<div id='UIItem21' style="display: inline-block">
What is the estimated deployment completion date?
<br>
<br>
<input type="text" id="datepicker7">
<br>
<br>
</div>
【问题讨论】:
标签: javascript jquery html datepicker calendar