我们正在尝试将完整日历集成到 WordPress 网站的前端。我们面临的问题是大多数 WordPress 主题都有自定义样式,这些样式会改变表格的外观,使完整日历看起来很破损。
我不是 CSS 专家,所以非常感谢任何帮助。有什么方法可以重置样式,以便 Full Calendar 自己的样式始终应用于同一样式集,而不管页面上可能加载的任何其他样式如何?
谢谢:)
最佳答案
也许你可以尝试删除他们的 css,并在那里添加你的 css 类。
这对我有用(版本 v1.5.4),
$('#calendar').fullCalendar({
...
,eventRender: function(event, element) { //render how event look like
// example add element
element.attr("category",event.title);
//example to remove the original color
//element.find("div").removeClass("fc-event-skin fc-event-inner");
//OR
//element.find("div").css({"background-color":"transparent","border-color":"transparent"});
//element.css({"background-color":event.colors,"border-color":"transparent"});
//example to add class
if(event.title === "big_event"){
element.addClass("calred");
}
},
viewDisplay : function(view) { //render how calendar look like
//example coloring on sat,sun
$(".fc-sat, .fc-sun").addClass("ss-holiday");
$("th.fc-sat, th.fc-sun").removeClass("ss-holiday");
}
...
});
关于css - 全日历样式重置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38701811/