Highlight day in jQuery UI calendar widget

核能气质少年 提交于 2019-12-25 07:49:37

问题


I have a jQuery UI calendar widget that's displayed in my web application. I'd like to be able to highlight a specific day of the month when the user performs an action. Is there any way to do this?


回答1:


HTML :

<div id="datepicker"></div>

jQuery :

$('#datepicker').datepicker({
            beforeShowDay: function(date) {
             if (date == myDate) {
              return [true, 'css-class', 'ToolTip'];

              }
           }
});

You need to write a CSS class for css-class. For more information Click Here




回答2:


Use this code

//Set DatePicker to April 25,2014
$('#dateselector').datepicker("setDate", new Date(2014,4,25) );

Refer the following links for more details :

  1. http://api.jqueryui.com/datepicker/#method-setDate

  2. https://forum.jquery.com/topic/datepicker-simple-highlighting-of-specific-days-who-can-help-source-inside

Hope it helps.



来源:https://stackoverflow.com/questions/9075412/highlight-day-in-jquery-ui-calendar-widget

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