Fullcalendar with Twitter Bootstrap Popover

后端 未结 4 1477
暖寄归人
暖寄归人 2021-02-02 14:41

I am trying to get Fullcalendar working with twitter boostrap popovers.
if I click an event, i want to show some details in the popover.
So first added this lil snippet

4条回答
  •  南方客
    南方客 (楼主)
    2021-02-02 15:29

    For days ;

            dayClick: function (date, jsEvent, view) {
                //return eventCreate(date, null, jsEvent, view);
                var CurrentDay = $(this);
    
                CurrentDay.popover({
                    html: true,
                    placement: 'auto',
                    title: date.format(),
                    container:'#calendar',
                    content: function() {
                        setTimeout(function () {
                            CurrentDay.popover('hide');
                        }, 2000);
                        return $("#popover-day").html();
                    }
                });
                CurrentDay.popover('toggle');
        },
    

    For Events;

            eventRender: function (event, element, view){
            var dStart = event.title
            element.popover({
                animation: true,
                placement: 'top',
                html: true,
                container: 'body',
                title: dStart,
                trigger: 'click',
                content: function() {
                    setTimeout(function () {
                        element.popover('hide');
                    }, 2000);
                    return $('#popover-content').html();
                }
            });
        },
    

    In your HTML;

    
    
    
    

提交回复
热议问题