问题描述
我在网页上有以下标记和JS:
看起来效果很好。
当我打开一个窗口,datepicker无法正确加载。
任何想法我可以如何使日期戳工作?
datepicker不能正常工作,因为它可能是在onLoad功能。尝试Colorbox.js,它有一个专门用于处理这个的onComplete。
http://colorpowered.com/colorbox/
JavaScript / jQuery在ColorBox内部不起作用。
通常是因为在加载到文档中之前尝试访问一个元素,并且可以通过将JavaScript移动到ColorBox的onComplete回调来解决。
示例(使用jQuery Forms插件)
$('#login_window')。colorbox({onComplete:function(){
$('form#login')。ajaxForm();
}}) p>
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?
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();}});
这篇关于一个Thickbox中的jQuery UI Datepicker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!