日期选择器点击图像后不出现 [英] date picker not appearing after clicking on image
本文介绍了日期选择器点击图像后不出现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
< html>
< head>
< script type =text / javascriptsrc =mootools-yui-compressed.js>< / script> // mootools脚本
< script type =text / javascript src =datepicker.js>< / script>
< link rel =stylesheettype =text / csshref =datepicker.css/>
< / head>
< body>
< input name ='date_allow_empty'type ='text'value =''class ='date picker'/>
< div id =invokeDP>< / div>
< script type =text / javascript>
var dp = new DatePicker('。picker',{
pickerClass:'datepicker',
allowEmpty:true,
toggleElements:['invokeDP']
} );
< / script>
< / body>
< / html>
编辑:我已将所有脚本都存入头部
部分,以前这些脚本位于 body
部分
解决方案
我想你错过了一个 mootools核心库
。
< script src =http://fiddle.jshell.net/js/lib/mootools-core-1.4。 5-nocompat.js>< / script>
这是我的工作解决方案 http://jsbin.com/unosar/4/edit#source (点击渲染按钮进行预览)
I have a fiddle which displays date picker. same code i have written below but nothing happens, what wrong i am doing? When i click on that green colour then no date picker is generated, but in fiddle it is coming fine, where i am doing wrong?
<html>
<head>
<script type="text/javascript" src="mootools-yui-compressed.js"></script>//mootools script
<script type="text/javascript" src="datepicker.js"></script>
<link rel="stylesheet" type="text/css" href="datepicker.css" />
</head>
<body>
<input name='date_allow_empty' type='text' value='' class='date picker' />
<div id="invokeDP"></div>
<script type="text/javascript">
var dp = new DatePicker('.picker', {
pickerClass: 'datepicker ',
allowEmpty: true,
toggleElements: ['invokeDP']
});
</script>
</body>
</html>
EDIT: I have taken all scripts inside head
section, previously these scripts were in body
section
解决方案
I think you miss a mootools core library
.
<script src="http://fiddle.jshell.net/js/lib/mootools-core-1.4.5-nocompat.js"></script>
Here is my working solution http://jsbin.com/unosar/4/edit#source (click at Render button to preview)
这篇关于日期选择器点击图像后不出现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文