Jquery datepicker does not work inside lightbox

后端 未结 4 1938
失恋的感觉
失恋的感觉 2020-12-22 10:10

After some problems solved, I got a tricky stuff. I am using an overlay plugin for JQuery called prettyPhoto.

Just wanna make an overlay with a form. The form is hid

4条回答
  •  我在风中等你
    2020-12-22 10:51

    Your overlay plugin 'prettyPhoto' create a new DOM everytime it is triggered, so the 'focus' event that datepicker is bounded to, does not exist on the DOM element in your lightbox.

    Here is one person who had the same problem:

    jQuery live() failing with jQuery UI datepicker

    You'll probably need something like this:

    $('#overlayData').live('click', function (){
      $(this).datepicker({dateFormat: 'dd/mm/yy'});
    });
    

提交回复
热议问题