Jquery UI Datepicker not displaying

前端 未结 21 1203
半阙折子戏
半阙折子戏 2020-12-05 18:10

UPDATE
I have reverted back to Jquery 1.3.2 and everything is working, not sure what the problem is/was as I have not changed anything else apart of t

21条回答
  •  余生分开走
    2020-12-05 18:24

    I had the same issue: the Date Picker was added successfully (and could even be found in FireBug), but was not visible. If you use FireBug to remove the class "ui-helper-hidden-accessible" from the Date Picker div (ID of: "ui-datepicker-div"), the Date Picker becomes visible and will work like normal.

    If you add the following at the very end of your $(document).ready() function, it will apply this to every Date Picker on you page, and make them all work:

    $(document).ready(function() {
          //...
          //Put all of you other page setup code here
          //...
    
          //after setting everything up (including adding all Date Pickers)
          //apply this code to every Date Picker
          $('#ui-datepicker-div').removeClass('ui-helper-hidden-accessible');  
    });
    

    That was my initial fix. Afterwards, I tried the solution suggested above by Brian Mortenson and it both worked perfectly, and seemed less invasive than removing an entire class from the element. So I modified my code to apply his solution to the method I used (apply at the end of the document setup so that it applies to every Date Picker and does not require repeating):

    $(document).ready(function() {
          //...
          //Put all of you other page setup code here
          //...
    
          //after setting everything up (including adding all Date Pickers)
          //apply this code to every Date Picker
          $('#ui-datepicker-div').css('clip', 'auto');  
    });
    

    Hope this helps to get someone unstuck.

    EDIT: Fixed a code syntax error.

提交回复
热议问题