jQuery FullCalendar>如何在每天添加按钮(或div)?

Sau*_*nda 2 jquery fullcalendar

我想通过点击每天右下角的一个小加号(+)(在月视图中),让我的用户能够将事件添加到jQuery fullCalendar中.实现这一目标的最佳方法是什么?

一个黑客十岁上下的方式,我发现是分配background-imagetd.fc-widget-contentbackground-position: bottom right,然后使用dayClick回调.但是,只要我想为每个单元格添加一个按钮,这将会中断.

有没有更好的方法来实现这一目标?

Gan*_*ede 5

将"添加事件"按钮添加到eventAfterAllRender.见下文:

eventAfterAllRender: function(view){
    if(view.name == 'month')
    {                       
        $('.fc-day').each(function(){
            $(this).css('position','relative');
            $(this).append('<a class="add_event_label" `enter code here`style="position:absolute;bottom:0;left:0;right:0;display: block;border-top:1px solid black;font-size:12px;color:#000;text-align:center;cursor:pointer;">(+)Add Event</a>');
        });      
    }                   
}
Run Code Online (Sandbox Code Playgroud)