【发布时间】:2017-10-23 04:13:05
【问题描述】:
我不知道如何在 customButton 初始化后更改它的文本。从下面的示例代码中,文本设置为“自定义!”。但我想动态改变它?有没有可以实现这个的jQuery方法调用?
$('#calendar').fullCalendar({
customButtons: {
myCustomButton: {
text: 'custom!',
click: function() {
alert('clicked the custom button!');
}
}
},
header: {
left: 'prev,next today myCustomButton',
center: 'title',
right: 'month,agendaWeek,agendaDay'
}
});
【问题讨论】:
-
您可以像这样动态设置选项:fullcalendar.io/docs/utilities/dynamic_options - 您可能必须立即重新定义整个 customButtons 属性。试一试。
-
你到底想什么时候改变文本,我的意思是什么事件会触发它?当你点击它?事件何时加载?
-
@Don'tPanic 我想在单击自定义按钮时更改文本。
标签: javascript button text dynamic fullcalendar