簡體   English   中英

如何使用Datepicker JavaScript

[英]How to use datepicker javascript

我曾瀏覽過這個網站:

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>

任何人都知道我的代碼有什么問題,請幫助

謝謝

實際上,您不包括資產。 您必須將鏈接,樣式表和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>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM