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

javascript - Using custom CSS for custom buttons (FullCalendar) - Stack Overflow

programmeradmin3浏览0评论

I have 2 custom buttons for my own fixed prev and next functions. I like all the buttons how they are but need to make the << and >> for those 2 buttons bigger, so I have to change the FontSize I guess. What is the best way to do this by preserving the other buttons (including their current FontSize) as they are? My code:

      customButtons: {
        prevMonth: {
          text: '<<',
          click: function() {
            calendar.changeView( 'resourceTimelineMonth');
            calendar.incrementDate( { days: -31 } );
          }
        },
        nextMonth: {
          text: '>>',
          click: function() {
            calendar.changeView( 'resourceTimelineMonth');
            calendar.incrementDate( { days: 31 } );
          }
        }
      },
      headerToolbar: {
        center: 'week,d14,month',
        right: 'today prevMonth,prev,next,nextMonth'
      },

I have 2 custom buttons for my own fixed prev and next functions. I like all the buttons how they are but need to make the << and >> for those 2 buttons bigger, so I have to change the FontSize I guess. What is the best way to do this by preserving the other buttons (including their current FontSize) as they are? My code:

      customButtons: {
        prevMonth: {
          text: '<<',
          click: function() {
            calendar.changeView( 'resourceTimelineMonth');
            calendar.incrementDate( { days: -31 } );
          }
        },
        nextMonth: {
          text: '>>',
          click: function() {
            calendar.changeView( 'resourceTimelineMonth');
            calendar.incrementDate( { days: 31 } );
          }
        }
      },
      headerToolbar: {
        center: 'week,d14,month',
        right: 'today prevMonth,prev,next,nextMonth'
      },
Share Improve this question asked Dec 6, 2020 at 10:41 RomeRome 44211 silver badges28 bronze badges 2
  • Probably with the class for those two buttons – Aleksandar Commented Dec 6, 2020 at 11:01
  • Sure but the issue is that custom buttons share their classes with the other buttons which are not supposed to change. – Rome Commented Dec 6, 2020 at 11:49
Add a ment  | 

1 Answer 1

Reset to default 5

Add this to your CSS:

.fc .fc-prevMonth-button,
.fc .fc-nextMonth-button {
  font-size: 18px;
}
发布评论

评论列表(0)

  1. 暂无评论