【问题标题】:How do you use qtip Modal on fullCalendar?你如何在 fullCalendar 上使用 qtip Modal?
【发布时间】:2014-08-19 21:39:46
【问题描述】:

如何从 qTip 为我的全日历事件实现此代码?这是 qTip 插件的一个模式功能,我希望每当我单击日历中的事件时显示此模式。

这是教程的链接: http://craigsworks.com/projects/qtip/demos/effects/modal#

【问题讨论】:

  • 我的回答对你有帮助吗?
  • 干得好,先生!谢谢! :)

标签: fullcalendar qtip


【解决方案1】:

这是一个关于如何在点击事件时创建 qtip 的示例。出于性能原因,模式是针对指定事件的 onclick 创建的,而不是针对所有事件的 onpageload。

$(document).ready(function() {
   // watch for click on the event elements
   $(document).on('click', '.fc-event', function(){

      // qtip already is created for this event -> leave this function -> the modal gets opened
      if($(this).data('qtip')) {
         return;
      }

      // no qtip for this event created -> create it
   $(this).qtip(
      {
         content: {
            title: {
               text: 'Modal qTip',
               button: 'Close'
            },
            text: 'Heres an example of a rather bizarre use for qTip... a tooltip as a <b>modal dialog</b>! <br /><br />' +
               'Much like the <a href="http://onehackoranother.com/projects/jquery/boxy/">Boxy</a> plugin, ' +
               'but if you\'re already using tooltips on your page... <i>why not utilise qTip<i> as a modal dailog instead?'
            },
            position: {
               target: $(document.body), // Position it via the document body...
               corner: 'center' // ...at the center of the viewport
            },
            show: {
               when: 'click', // Show it on click
               solo: true // And hide all other tooltips
            },
            hide: false,
            style: {
               width: { max: 350 },
               padding: '14px',
               border: {
                  width: 9,
                  radius: 9,
                  color: '#666666'
               },
               name: 'light'
            },
            api: {
               beforeShow: function()
               {
                  // Fade in the modal "blanket" using the defined show speed
                  $('#qtip-blanket').fadeIn(this.options.show.effect.length);
               },
               beforeHide: function()
               {
                  // Fade out the modal "blanket" using the defined hide speed
                  $('#qtip-blanket').fadeOut(this.options.hide.effect.length);
               }
            }
         });

      // show it after creation
      $(this).qtip('toggle', true);
   });
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-12-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-08
    • 2012-04-29
    相关资源
    最近更新 更多