一个Thickbox中的jQuery UI Datepicker [英] jQuery UI Datepicker inside a Thickbox

查看:181
本文介绍了一个Thickbox中的jQuery UI Datepicker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网页上有以下标记和JS:
http://jsfiddle.net/R2Jj2 /



看起来效果很好。



当我打开一个 thickbox 窗口,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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆