我正在尝试使用 jQuery datepicker 工具,但它不起作用。我是 jQuery 新手,所以我不太了解它。有人能发现我哪里出错了吗?我在标题中的链接是否正确?
html:
<html>
<head>
<title>CodeProject</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script type='text/javascript' src='javascript.js'></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
</head>
<body><h2>Date Picker</h2>
<p>I will be making a simple date picker tool using jQuery. You have have seen it in some</br> travel websites where when you move your cursor on a date field, you see a little pop-up which allows you to pick a date.</p></br>
<p>Departure date:<input type="text" id="departure"></p>
<p>Returning date:<input type="text" id="returning"></p>
<button>Submit</button>
</body>
jQuery 文件:
$(document).ready(function() {
$("#departure").datepicker();
$("#returning").datepicker();
});
CSS 文件:
#header {
background-color: white; /**#212121**/
margin-bottom: 0px;
margin-left: 0;
margin-top: 0px;
z-index: 1px;
width: 99.2%;
border-bottom: 2px solid #212121;
}
h1 {
text-align: left;
font-family: times, Times New Roman, times-roman, georgia, serif;
color: #444;
padding: 0px 0px 6px 0px;
font-size: 51px;
line-height: 44px;
letter-spacing: -2px;
font-weight: bold;
padding-left: 10px;
}
span {
color: #7EAEDE;
font-size: 20px;
letter-spacing: 4px;
}
h2 {
font-family: Georgia, "Times New Roman", Times, serif;
font-size:30px;
margin-top: 0px; margin-bottom: 10px;
text-align: left;
font-weight: normal;
color: #222;
}
h4 {
font-family: "Lucida Grande", Tahoma;
font-size: 10px;
font-weight: lighter;
font-variant: normal;
text-transform: uppercase;
color: #666666;
margin-top: 10px;
text-align: left!important;
letter-spacing: 0.3em;
margin-left: 2px;
}
#p1 {
font-family: 'Hoefler Text', Georgia, 'Times New Roman', serif;
font-weight: normal;
font-size: 1.75em;
letter-spacing: .2em;
line-height: 1.1em;
margin:0px;
text-align: center;
text-transform: uppercase;
color: #1BA8E0;
}
body {
background-color: grey;
margin: 0; /**body has margin by default so we 0 to get rid of it **/
}
#wrapper {
width:700px; /**Get everything in the wrapper to be within this width of 700px**/
margin: 0 auto; /**centre everything**/
background-color: white;
margin-top: 0px;
border: 2px solid #444;
border-top: 0px;
}
.border { /**Separated by a dotted line**/
border-bottom: 1px dotted black;
border-top: 1px dotted black;
}