简体   繁体   中英

how to keep popover visible when i hover on the popover in full calendar?

I have full calendar with some events. I have binded events from a json file. When i mouse hover on the particular event in the calendar it will show a popover. But when i move my mouse to the popover, the popover disappears. How to keep the popover visible when i move my mouse into the popover ? i have gone through other examples but didn't worked for me. popover bootstap

link 2

code :

        $('#calendar').fullCalendar({
//$.fn.popover.defaults.container = 'body';
            header: {
                left: 'prev,next',
                center: 'title',
                right: 'month,agendaWeek,agendaDay'
            },
            contentHeight: 300,
            height: 200 ,
            eventRender: function(event, element) {
                element.popover({
                    title: event.title1,
                    placement: 'auto',
                    html: true,
                    trigger: 'hover',
                    animation:'true',
                    content: event.msg,
                    container: 'body'
                });
                $('body').on('click', function(e) {
                    if (!element.is(e.target) && element.has(e.target).length === 0 && $('.popover').has(e.target).length === 0)
                        element.popover('hide');
                });
            },
            events: eventData 
        });

    }
    });

I don't know if can be an acceptable solution for you, but as alternative you can consider to 'toggle' popover on eventMouseover:

eventMouseover: function (event, jsEvent) {
        $(this).popover({
            title: event.name,
            placement: 'right',
            trigger: 'manual',
            content: 'foo',
            container: '#calendar'
        }).popover('toggle');
    }

In this way popover stays on top until you re-hover on event (Bootstrap v3.3.2, FullCalendar v2.6.1).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM