找不到jquery函数
我在使用 Jquery 日期时间选择器时遇到了问题。滑块不适用于触摸设备。幸运的是,已经找到了解决方案,并且 已实现
但是更新 Jquery datetimepicker 代码给了我错误:
$tp.find(".ui-slider:visible").sliderAccess is not a function
这是来自 Jquery Datetime picker 文件本身,所以不是我编写的代码。
我能想到的唯一合乎逻辑的事情是,我缺少依赖项?但没有提及任何一个。
$(".dateTimePicker").datetimepicker({ dateFormat: 'dd/mm/yy' , addSliderAccess: true, sliderAccessArgs: { touchonly: false} }); // dateFormat: 'dd/mm/yy'
$(".datePicker").datepicker({ dateFormat: 'dd/mm/yy', showButtonPanel: true }); // dateFormat: 'dd/mm/yy'
$(".timePicker").timepicker({ stepMinute: 5, addSliderAccess: true, sliderAccessArgs: { touchonly: false} });
有谁知道我做错了什么。
I've been having problems with Jquery Datetime picker. The slider wouldn't work on touch devices. Luckily the solution has since been found and Implemented
But updating the Jquery datetimepicker code, is giving me the error:
$tp.find(".ui-slider:visible").sliderAccess is not a function
This is coming from the Jquery Datetime picker file itself, so is not code I have written.
The only logical thing I can think of is, I'm missing a dependancy? But there is no mention for one.
$(".dateTimePicker").datetimepicker({ dateFormat: 'dd/mm/yy' , addSliderAccess: true, sliderAccessArgs: { touchonly: false} }); // dateFormat: 'dd/mm/yy'
$(".datePicker").datepicker({ dateFormat: 'dd/mm/yy', showButtonPanel: true }); // dateFormat: 'dd/mm/yy'
$(".timePicker").timepicker({ stepMinute: 5, addSliderAccess: true, sliderAccessArgs: { touchonly: false} });
Does anyone know what Im doing wrong.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否包含所有 .js 文件?查看示例页面的源代码,您可以看到它包括
Are you including all of the .js files? Looking at the source code of example page you can see it's including
为方便起见,您可以在此处获取 jquery-ui-sliderAccess.js 文件。从实际的项目页面来看,从哪里获取它并不明显。
http://trentrichardson.com/examples/timepicker/js/jquery-ui -sliderAccess.js
For convenience, this is where you can get that jquery-ui-sliderAccess.js file. It's non-obvious from the actual project page where to get this.
http://trentrichardson.com/examples/timepicker/js/jquery-ui-sliderAccess.js
正如 @CCBlackburn 所说,您缺少滑块,
我还建议您从 github 网站下载,单击带有云和箭头的 Zip 按钮:
https://github.com/trentrichardson/jQuery-Timepicker-Addon
As @CCBlackburn is saying, you are missing the slider include
I would also recommend to download from the github website, Click on the Zip button with a Cloud on it and arrow:
https://github.com/trentrichardson/jQuery-Timepicker-Addon