Open fullcalendar event links in new tab/window?

WordPress Event Management, Calendars & Registration Forums General Question Open fullcalendar event links in new tab/window?

This topic contains 2 replies, has 2 voices, and was last updated by  Geoff Pimlatt 9 years, 8 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #12342

    Hello Stephen,

    Sorry to bother you again so soon, but this question’s much simpler.

    Basically, I was wondering if it were possible to add a ‘target=”_blank”‘ attribute to the links on the event (full)calendar somewhere (or some other JS solution), and I’ve been searching on your website and in this forum for about twenty minutes without any luck.

    It’s okay if there isn’t an option! I just assumed it would be possible and am not sure if I overlooked something.

    Paul

    Geoff Pimlatt
    #12372

    Hi Paul,

    Apologies for the delay in getting back to you. Unfortunately there isn’t an option. However, I suspect you could listen for a click on the event, and then open the event in a new window by adding something like the following to the page:

     jQuery('.eo-fullcalendar').on( 'click', '.fc-event', function(e){
        e.preventDefault();
        window.open( jQuery(this).attr('href'), '_blank' );
    });
    Stephen Harris
    #12401

    Alright, thanks a lot! Works exactly as intended.

    Geoff Pimlatt
Viewing 3 posts - 1 through 3 (of 3 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.