jQuery timepicker won't work
I can't seem to get my jQuery time picker to work at all. Nothing happens when I click the input box. Any idea what I'm doing wrong?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;开发者_开发知识库 charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.5.custom.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-timepicker-addon.min.js"></script>
<link rel="stylesheet" href="css/redmond/jquery-ui-1.8.5.custom.css" type="text/css" title="ui-theme" />
<script type="text/javascript">
$(function(){
$('#errorDate').datepicker();
});
</script>
<style>
.ui-timepicker-div .ui-widget-header{ margin-bottom: 8px; }
.ui-timepicker-div dl{ text-align: left; }
.ui-timepicker-div dl dt{ height: 25px; }
.ui-timepicker-div dl dd{ margin: -25px 0 10px 65px; }
.ui-timepicker-div .ui_tpicker_hour div { padding-right: 2px; }
.ui-timepicker-div .ui_tpicker_minute div { padding-right: 6px; }
.ui-timepicker-div .ui_tpicker_second div { padding-right: 6px; }
.ui-timepicker-div td { font-size: 90%; }
</style>
</head>
<body>
<input type="text" id="errorDate" name="errorDate" class="hasDatepicker">
</body>
</html>
When I take away the class="hasDatepicker" from your input, it seems to start working.
I am fairly certain that a reference to jquery.ui.core.min.js
is required for all jQuery ui widgets to work, including datepicker
<script type="text/javascript" src="js/jquery.ui.core.min.js"></script>
精彩评论