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