views:

74

answers:

1

Okay... I am still fairly new to using jquery and javascripting. I have successfully implemented the Jquery FullCalendar on my site and linked it to GCal events.

Is there any way I can have the events, when clicked, to popup in a Modal Window? ie. just like how the embedded calendar that google provides.

My code:

$(document).ready(function () {

    $('#calendar').fullCalendar({
        theme: true,
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek,agendaDay'
        },
        editable: true,
        events: $.fullCalendar.gcalFeed(
        "http://www.google.com/calendar/myxlmfeed"
    ),
        eventClick: function (event) {
            if (event.url) {
                window.open(event.url);
                return false;
            }
        }
    });

});

The code I provided has an eventClick but it opens a new window, anyway I can code that so it opens a simple modal popup?

Any help on this would be so appreciated!

Jay

A: 

use nyromodal, a popular jQuery plugin, and modify your code appropriately:

<script type='text/javascript'>
$(document).ready(function () {
    $('#calendar').fullCalendar({
        editable: true,

        events: "some json URL",

        eventClick: function (event) {
            $.nyroModalManual({
                url: event.url
            });
            return false;
        }
    });
});

kcd