我希望能够覆盖 "eonasdan-datetimepicker" (https://github.com/Eonasdan/bootstrap-datetimepicker) 的默认样式,以显示基本的悬停信息。
默认情况下,禁用日期使用以下 CSS 属性:
.bootstrap-datetimepicker-widget table td span.disabled,
.bootstrap-datetimepicker-widget table td span.disabled:hover {
background: none;
color: #777777;
cursor: not-allowed;
}
.bootstrap-datetimepicker-widget table th.disabled,
.bootstrap-datetimepicker-widget table th.disabled:hover {
background: none;
color: #777777;
cursor: not-allowed;
}
.bootstrap-datetimepicker-widget table td span.disabled,
.bootstrap-datetimepicker-widget table td span.disabled:hover {
background: none;
color: #777777;
cursor: not-allowed;
}
我想显示一个基本的悬停消息,使用title属性。我的当前尝试完全不起作用,我将此代码放在document.ready函数中。
if ($(".bootstrap-datetimepicker-widget").attr('th, td, span', 'disabled') == 'true')
{
$(".bootstrap-datetimepicker-widget").attr('title', 'This date is disabled');
}
谢谢
[data-day="12/25/2017"]
css 属性选择器来覆盖特定日期的内容。https://developer.mozilla.org/zh-CN/docs/Web/CSS/Attribute_selectors - BenG