最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How do you apply twitter modal popup on fullcalendar event click - Stack Overflow

programmeradmin2浏览0评论

I'm using the fullCalendar jQuery plugin right now and I'm planning to apply the Twitter Modal Bootstrap on eventClick. How do I apply this method for my calendar plugin? Thanks in advance!

I'm using the fullCalendar jQuery plugin right now and I'm planning to apply the Twitter Modal Bootstrap on eventClick. How do I apply this method for my calendar plugin? Thanks in advance!

Share Improve this question asked Aug 22, 2014 at 7:47 cartmandercartmander 1821 gold badge4 silver badges13 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 7

You can acplish that by doing something like:

eventClick: function(event) {
    var modal = $("#modal");
    modal.find(".modal-title").html(event.title);
    modal.modal();
}

For plete code and functionality see the following jsfiddle

I just saw this question and I thought this may help someone. This code worked for me:

$(document).ready(function() {
var $calPopOver;
$('#calendar').fullCalendar({
    defaultDate: '2015-07-23',
    header: {
        left: 'prev,next today',
        center: 'title',
        right: 'month,agendaWeek,agendaDay'
    },
    eventMouseover: function (date, allDay, jsEvent, view) {
        $(this).children().popover({
            title: '<p>Lorem ipsum dolor sit amet</p>',
            placement: 'right',
            content: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.',
            html: true,
            container: 'body'
        });
        if($calPopOver)
            $calPopOver.popover('destroy');
        $calPopOver = $(this).children().popover('show');
    },
    eventLimit: false, // allow "more" link when too many events
            events: [
            {
                title: 'All Day Event',
                start: '2015-07-04'
            },
            {
                title: 'Long Event',
                start: '2015-07-18',
                end: '2014-07-19'
            },        
            {
                title: 'Click for Google',
                url: 'http://google./',
                start: '2015-07-23'
            }
        ]
}); });

To get the hover effect you can change from "eventClick" to "eventMouseover"

http://jsfiddle/MadalinaTn/1Lmejhmx/2/

发布评论

评论列表(0)

  1. 暂无评论