gpt4 book ai didi

JavaScript 添加类不起作用?

转载 作者:行者123 更新时间:2023-11-28 20:36:47 25 4
gpt4 key购买 nike

我有以下 JS 函数:

function addTopLinks() {

$('#calendar .fc-view-resourceNextWeeks thead th .fc-resourceName')
.addClass('top-cell');
};

它没有添加类。

我还有另一个:

function addDayClass() {
$('#calendar .fc-view-resourceNextWeeks thead th')
.filter(function () {
if ($(this).text().indexOf('Mon ') == 0) return true;

return false;
})
.addClass('monday');
};

那个工作得很好。

这是层次结构:

enter image description here

我真的不确定为什么第一个有效,而这个却不起作用......

谢谢

最佳答案

更改您的选择器,而不是:

'#calendar .fc-view-resourceNextWeeks thead th .fc-resourceName'

尝试:

'#calendar .fc-view-resourceNextWeeks thead th.fc-resourceName'

关于JavaScript 添加类不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15227936/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com