我们正在尝试将完整日历集成到WordPress网站的前端。我们面临的问题是,大多数WordPress主题都有自定义样式,可以改变表格的外观,使完整日历看起来破碎。
我不是CSS专家,所以非常感谢任何帮助。有没有办法重置样式,以便完全日历自己的样式始终应用于相同的样式集,无论页面上可能加载任何其他样式?
谢谢:)
答案 0 :(得分:0)
也许你可以尝试删除他们的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");
}
...
});