jQuery UI Datepicker: don't highlight today when it is also selected

前端 未结 4 875
攒了一身酷
攒了一身酷 2021-01-06 06:26

I\'m using the jQuery datepicker to select dates. It works fine, except there is 1 default behavior that I would like to change. When you select a day, the selected day is

4条回答
  •  北海茫月
    2021-01-06 06:47

    Since it took me a while to figure out how to exactly replicate the "selected" style over top of the today style even with the answer from PHPexperts.ca, here's a bit more information that might make it a bit more straightforward if you're having trouble.

    If you select a day other than "today", the style that you should copy for an identical look when "today" is selected is in the a tag and in the selector

    .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active

    This should be easy to find if you have Firefox with Firebug installed (select the date, reopen the datepicker, right click and select 'inspect element'.

    For the jQuery UI theme 'UI darkness' the style to copy into your override css is

    .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { background:url("images/ui-bg_inset-soft_30_f58400_1x100.png") repeat-x scroll 50% 50% #F58400; border:1px solid #FFAF0F; color:#FFFFFF; }

    If you change the theme, it looks like all 3 of these styles change.

提交回复
热议问题