本文介绍了eventClick与lightBox?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



谢谢!

如何在eventClick中打开lightBox,我实际上最终使用了fancybox,并且我设法使它工作的方式是使用 eventAfterRender 来绑定它。解决方案
我不必为 eventClick 做任何事情来阻止网址跟踪,我认为fancybox会照顾到这一点。当我在 eventClick 中执行相同的连线时,它不起作用,因此您可能想要使用lightbox来看这个例子,看看它是否也适用于您。这是我所做的相关部分。干杯!

  $('#calendar')。fullCalendar({
eventAfterRender:function(event,element,view ){
if(event.url){
$('a',$(element))。fancybox({
type:'ajax'
});
}
}
});


How I can open lightBox in eventClick, I need init a lightBox whe I click in a event.

Thanks!!

解决方案

I actually ended up using fancybox and the way I managed to get it working was to use the eventAfterRender to bind it up. I didn't have to do anything to the eventClick to prevent url follow, I think fancybox took care of that. It didn't work when I performed this same wire up in the eventClick so you might want to follow this example with lightbox and see if that works for you as well. Here is the relevant part of what I did. Cheers!

$('#calendar').fullCalendar({
    eventAfterRender: function(event, element, view ) { 
        if(event.url) {
            $('a',$(element)).fancybox({
                type: 'ajax'
            });
        }                    
    }    
});

这篇关于eventClick与lightBox?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-19 06:32