How to add a custom class to my JQuery UI Datepicker

前端 未结 4 2002
鱼传尺愫
鱼传尺愫 2020-12-10 11:24

I have several inputs which trigger JQuery UI datepickers e.g.





        
4条回答
  •  南方客
    南方客 (楼主)
    2020-12-10 11:55

    Jquery UI custom download allows you to add a custom prefix to your theme, say you added a prefix ".datepicker_wrapper" you can add this class to your datepicker this way :

     $('.datepicker').datepicker({
          beforeShow : function(){
               if(!$('.datepicker_wrapper').length){
                    $('#ui-datepicker-div').wrap('');
               }
          }
     });
    

提交回复
热议问题