我有一个Reactjs FullCalendar,我想要什么时候,我悬停在天的单元格上,背景也会是蓝色的,这个单元格的时间会出现。
我试试这个:
.fc-widget-content td:hover {
background-color: blue;
}
但是,我得到:
https://i.stack.imgur.com/sCKOq.gif
但是,我想像这样独立地将每个单元格悬停在每一天:
https://i.stack.imgur.com/v9FSh.gif
他的代码是:
<td onmouseover="highlightBG(this);" onmouseout="nohighlightBG(this);" style="color: transparent; height: 1.5em; text-align: right; padding-right: 2px; background-color: initial;"><span style="font-weight:900;">8:35</span></td>
function highlightBG(element) {
element.style.backgroundColor = '#39b6f0';
element.style.color = 'black';
}
function nohighlightBG(element) {
element.style.backgroundColor = 'initial';
element.style.color = 'transparent';
}
我该如何解决?