fullcalendar with clickable popup on hover

后端 未结 8 2264
名媛妹妹
名媛妹妹 2020-12-13 11:12

I need a pop up on hover full calendar like this one.

Have tried full calendar with qtip but could not get clickable popup its disappers when mouse is out from the s

相关标签:
8条回答
  • 2020-12-13 11:32

    check this example. http://jsfiddle.net/craga89/N78hs/

    eventClick: function(data, event, view) {
                var content = '<h3>'+data.title+'</h3>' + 
                    '<p><b>Start:</b> '+data.start+'<br />' + 
                    (data.end && '<p><b>End:</b> '+data.end+'</p>' || '');
    
                tooltip.set({
                    'content.text': content
                })
                .reposition(event).show(event);
            }
    

    it works on click, not in hover, but you can adapt it to work in hover as well

    0 讨论(0)
  • 2020-12-13 11:35

    I am doing this within Shopify with jQuery already active.

    I downloaded the bootstrap Tooltip plugin but actually preferred using the popover plugin.

    Having linked to the necessary bootstrap CSS and JS files I then had the following below. If you rather use tooltip you what I had worked, but I commented it out in preference of popover.

    $(document).ready(function() {
     $('#calendar').fullCalendar({
                    defaultView: 'month',
                    //eventBackgroundColor: 'red',
                    //weekends: false,
                    eventTextColor: '#FFFFFF',
                    hiddenDays: [ 0 ],
    
            header: {
                left: 'prev,next',
                center: 'title',
                right: 'month,basicWeek,'
            },
    
    //              eventRender: function(event, element) {
    //                  $(element).tooltip({title: event.description});             
    //              },
    
            eventRender: function(event, element) {
              $(element).popover({title: event.title, content: event.description, trigger: 'hover', placement: 'auto right', delay: {"hide": 300 }});             
            },
    
            googleCalendarApiKey: 'XXXXXX',      
    
            eventSources: [
             {//BEGINNERS ACTING FUN
                googleCalendarId: 'XXXXX',
                color: '#990000',   // an option!
            },
             {//INTERMEDIATES SCENE WORK
                googleCalendarId: 'XXXX',
                color: 'purple',   // an option!  
            },
               {//INTERMEDIATES SCENE WORK
                googleCalendarId: 'XXX',
                color: 'blue',   // an option!  
            },
    
    
            {// VOICE & COMMUNICATION SKILLS
                googleCalendarId: 'XXXX',
                color: 'green',   // an option!
            }
    
            ]
    
        });
    
    });
    
    0 讨论(0)
提交回复
热议问题