0

我已经设置了 jquery datetimepicker,但它无法在 localhost 中正确显示(但在线可以)。图一是datetimepicker localhost,图二是datetimepicker online:

图片1

图二

谁有理想?谢谢!

4

1 回答 1

0

请检查您是否包含以下文件:

 1. jquery-ui-1.8.custom.css

    2. jquery-1.7.1.min.js

    3. jquery-ui-1.8.custom.min.js

示例html代码如下:

<!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=ISO-8859-1">
<title>DistribuTix</title>
<meta http-equiv="expires" content="">
<meta http-equiv="ImageToolbar" content="No">



<link href="css/style.css" rel="stylesheet" type="text/css">

<link rel="stylesheet" media="all" type="text/css" href="css/ui-lightness/jquery-ui-1.8.custom.css" />
<script src="js/jquery-1.7.1.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.custom.min.js"></script>
<style type="text/css">

  #ui-datepicker-div{ font-size: 80%; }

         /* css for timepicker */
        #ui-timepicker-div dl{ text-align: left; }
        #ui-timepicker-div dl dt{ height: 25px; }
        #ui-timepicker-div dl dd{ margin: -25px 0 10px 65px; }

 </style>

</head>
<body>


<input name="eventDate" id="eventDate" maxlength="20" size="17">


</body>

<script type="text/javascript">
$('#eventDate').datepicker({
 dateFormat: 'mm-dd-yy',
 showOn: "button",
 buttonImage: "../images/calendar.gif",
 buttonImageOnly: true
});
</script>
</html>

还要检查包含的文件是否在正确的路径中..

于 2012-07-21T07:41:02.243 回答