简体   繁体   English

将光标放在文本框中时,日期选择器未出现

[英]date picker not appearing when cursor is put in textbox

I have two date pickers appearing when green color is clicked, but when i am putting mouse cursor on those two text boxes, then nothing appears, only after clicking image/green color date picker is appearing. 单击green color时,我有两个日期选择器出现,但是当我将鼠标光标放在这两个文本框上时,什么都没有出现,只有在单击image/green color日期选择器之后才出现。 What modification should i do? 我应该怎么做?

In this below fiddle automatically date picker is appearing when cursor is put: 在下面的这个小提琴中,当放置光标时自动出现日期选择器:

http://jsfiddle.net/cBwEK/ http://jsfiddle.net/cBwEK/

I want to add the above function in below fiddle: 我想在小提琴下面添加以上功能:

http://jsbin.com/unosar/19/edit#javascript,html,live http://jsbin.com/unosar/19/edit#javascript,html,live

I am trying but nothing happens. 我正在尝试,但没有任何反应。 Any solution please 任何解决方案请

EDIT: BOTH THESE ABOVE EXAMPLES USE SAME css/js/mootools SCRIPTS 编辑:以上两个示例都使用相同的css / js / mootools脚本

The code in the two examples are different. 两个示例中的代码不同。 Try to set up an example that is more like your real code. 尝试建立一个更像您的真实代码的示例。 Try to do the same thing in the 2nd example: 尝试在第二个示例中做同样的事情:

new DatePicker('.picker', {
     pickerClass: 'picker ',
    allowEmpty: true
});

Add an click event on the textboxes: 在文本框中添加click事件:

$$('.date').addEvent('click', function() { 
      dp.show(); 
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM