FullCalendar dayClick not working (does nothing)

前端 未结 8 1725
天涯浪人
天涯浪人 2021-01-18 05:52

I am trying to get the \'dayClick\' function to work on FullCalendar, but when I press on any empty day, nothing happens. I have searched all over SO and cannot find any sol

相关标签:
8条回答
  • 2021-01-18 06:48

    Only relevant for FullCalender v2:

    I found that on my calendar the div with the class fc-bg was hidden by using display:none;. It turns out that this is what the dayClick event is attached to, and since it was hidden, I could not click on it.

    The reason why the fc-bg class had been hidden was because of a print CSS that I included on the page. It turns out that it is super important that this stylesheet has media="print" on the link, otherwise it will always be used.

    When including the FullCalendar CSS files on your page, ensure that the links are like this:

    <link href="/css/vendor/fullcalendar.min.css" rel="stylesheet" />
    <link href="/css/vendor/fullcalendar.print.css" media="print" rel="stylesheet" />
    
    0 讨论(0)
  • 2021-01-18 06:51

    My problem was close to: https://stackoverflow.com/a/39342912/6364246

    dayClick only worked when I clicked on the screen visible without scrolling. I changed html css{overflow-y:scrolling} to {overflow-y:visible} and worked

    0 讨论(0)
提交回复
热议问题