开发者

Datepicker inside hidden divs

开发者 https://www.devze.com 2023-04-11 09:11 出处:网络
I have certain divs that are hidden using jquery. Some of the divs have date input fields handled by datepicker.

I have certain divs that are hidden using jquery. Some of the divs have date input fields handled by datepicker.

Anytime I load my page, the browser gives this error:

Error: Unable to get value of the property 'inline': object is null or undefined

Datepicker is defined onReady

$(".datepicker").datepicker({
    inline: true
}开发者_开发问答);     

I tried to hide the divs using .hide()/show() and addClass('hidden'). but datepicker gives this error anyway.

Is there a way to solve this problem?


I have the same problem and I solved it by replacing the updated jQuery css.

version : jquery-1.7.js
css: jquery-ui-1.7.2.custom.css

I resolved it by replacing the updated css:

css: jquery-ui-1.8.21.custom.css


JQuery datepicker does not have the inline option.

If you want a datepicker inline, you must call datepicker() on a div, instead of an input.

<script>
  $(function() {
    $( "#datepicker" ).datepicker();
  });
</script>

Date: <div id="datepicker"></div>
0

精彩评论

暂无评论...
验证码 换一张
取 消