Thickbox 内的 jQuery UI 日期选择器
I have the following markup and JS on a web page:
http://jsfiddle.net/R2Jj2/
It seems to work well.
When I open this content in a thickbox window the datepicker fails to load properly.
Any idea how I can get the datepicker to work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
日期选择器无法正常工作,因为它可能正在调用 onLoad 函数中的内容。尝试 Colorbox.js,它有一个专门用于处理此问题的 onComplete。
http://colorpowered.com/colorbox/
JavaScript/jQuery 无法在 ColorBox 内部运行。< /strong>
这通常是由于在元素加载到文档之前尝试访问该元素,可以通过将 JavaScript 移至 ColorBox 的 onComplete 回调来解决。
示例(使用 jQuery Forms 插件):
$('#login_window').colorbox({onComplete:function(){
$('form#login').ajaxForm();
}});
The datepicker isn't working correctly because it's probably calling stuff within the onLoad function. Try Colorbox.js, it has an onComplete specifically for handling this.
http://colorpowered.com/colorbox/
JavaScript/jQuery is not working inside of ColorBox.
This is often due to trying to access an element before it has been loaded into the document and can be resolved by moving the JavaScript into ColorBox's onComplete callback.
Example (using jQuery Forms plugin):
$('#login_window').colorbox({onComplete:function(){
$('form#login').ajaxForm();
}});