我访问过这个网站:
http://www.monkeyphysics.com/mootools/script/2/datepicker
我完全遵循(我猜)他在那个网站上说的话,但仍然不起作用。下面是我的代码:
<!DOCTYPE html>
<html>
<script type="text/javascript" src="js/datepicker.js"></script>
<link rel="stylesheet" href="css/datepicker_jqui.css">
<style type="text/css">
input.date {
width: 150px;
color: #000;
}
</style>
<head>
<title></title>
</head>
<body>
<label>Datepicker with Vista skin:</label>
<input name='date_B' type='text' value='' class='date demo_vista' />
<label>Datepicker with OSX Dashboard skin:</label>
<input name='date_B' type='text' value='' class='date demo_dashboard' />
<label>Datepicker with jQuery UI skin:</label>
<input name='date_B' type='text' value='' class='date demo_jqui' />
<label>Datepicker basic (CSS only):</label>
<input name='date_B' type='text' value='' class='date demo' />
<script type="text/javascript">
window.addEvent('load', function() {
new DatePicker('.demo_vista', { pickerClass: 'datepicker_vista' });
new DatePicker('.demo_dashboard', { pickerClass: 'datepicker_dashboard' });
new DatePicker('.demo_jqui', { pickerClass: 'datepicker_jqui', positionOffset: { x: 0, y: 5 } });
new DatePicker('.demo', { positionOffset: { x: 0, y: 5 }});
});
</script>
</body>
</html>谁知道我的代码出了什么问题,请帮帮忙
谢谢
发布于 2016-08-14 15:09:48
实际上,你没有把你的资产包括在内。你必须把你的链接,样式表和js文件放在head标签里。
<html>
<head>
<title></title>
<script type="text/javascript" src="js/datepicker.js"></script>
<link rel="stylesheet" href="css/datepicker_jqui.css">
<style type="text/css">
input.date {
width: 150px;
color: #000;
}
</style>
</head>https://stackoverflow.com/questions/38939613
复制相似问题