【发布时间】:2015-09-02 10:38:21
【问题描述】:
我正在使用 JQueryUI 日期选择器,当第一次单击日历图像时,日历未显示。但是,当回发发生时,会显示日历。
我使用下面是代码sn-p来初始化datepicker:
$(function() {
var date = new Date();
var currentMonth = date.getMonth();
var currentDate = date.getDate();
var currentYear = date.getFullYear();
$("#ReportDate").datepicker({
showOn: "both",
buttonImage: "calendar.png",
buttonImageOnly: true,
buttonText: "Select date",
maxDate: new Date(currentYear, currentMonth, currentDate)
});
});
.ui-datepicker {
font-size: 8pt !important;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker</title>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div class="demo">
<b>Date:</b> <input type="text" id="ReportDate" />
</div>
</form>
</body>
</html>
谁能帮忙。我真的被困很久了。
【问题讨论】:
-
你能发一个小提琴吗
-
代码,fiddle 或 plunker。提供一些东西
-
您是在通知我们还是在询问?请发布您的代码和问题
-
您提供的代码小提琴不起作用!在您钓鱼为其他人发布代码之前,请确保
Run代码!此外,您发布的代码在语法上是错误的! -
您的代码小提琴不起作用!检查!
标签: jquery datepicker jquery-ui-datepicker