3
我想覆盖显示基本悬停消息的“eonasdan-datetimepicker”(https://github.com/Eonasdan/bootstrap-datetimepicker)的默认样式。 默认情况下禁用日期都使用这个CSS属性:覆盖样式在eonasdan-datetimepicker中禁用日期
.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;
}
我想显示的标题属性的基本悬停消息。 我目前的尝试根本没有工作,我把这个代码放在document.ready函数中。
if ($(".bootstrap-datetimepicker-widget").attr('th, td, span', 'disabled') == 'true')
{
$(".bootstrap-datetimepicker-widget").attr('title', 'This date is disabled');
}
谢谢
谢谢你,这是一个不错的选择。 – Jerry
嗨,谢谢你。这与我想要实现的目标非常接近。是否可以在悬停禁用日期上使用动态消息?防爆。如果我徘徊到1月1日,它会说“元旦”,12月25日到“圣诞节”。你能指出我正确的方向吗? –
@BryanAdams你可以使用'[data-day =“12/25/2017”] css属性选择器覆盖特定日子的内容。 https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors – BenG