jQuery UI Datepicker inside a Thickbox

孤街浪徒 提交于 2020-01-17 13:48:05

问题


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?


回答1:


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(); }});



来源:https://stackoverflow.com/questions/4809391/jquery-ui-datepicker-inside-a-thickbox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!