这是一个jsfiddle ,在 fiddle 中我已经包含了jquery 2和这个timepicker库http://jonthornton.github.io/jquery-timepicker/jquery.timepicker.js
输入的 ID 为 startTime
我在脚本中执行此操作:
<script type="text/javascript">
$('#startTime').timepicker();
</script>
问题是,当我单击该输入文本时,什么也没有出现,尽管教程指出这足以触发时间选择器下拉列表。
请问我缺少什么?
对于那些没有使用过这个库的人,这是它的链接 http://jonthornton.github.io/jquery-timepicker/您可以从这里下载 https://github.com/jonthornton/jquery-timepicker
最佳答案
您需要包含 jquery.timepicker.css
文件。
您应该使用文档就绪处理程序。喜欢
$(document).ready(function() {
$('#startTime').timepicker();
});
关于javascript - 时间选择器操作未触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24362761/