Slider revolution and fancybox-3 -
hi try implement fancybox 3 in carousel plugin slider revolution. next code work fancybox 2 fancybox 3 arrows not work. want o know if have solution.
link: https://www.themepunch.com/faq/using-fancybox-with-slider-revolution/
code work in fancybox2 not show arrows in fancybox3
/* change revapi1 whatever api name being used slider */ var api = revapi1;
/* no need edit below unless want change default fancybox settings */ api.on('revolution.slide.onloaded', function() {
jquery(this).find('.fancybox').each(function() { var $this = jquery(this); if(!$this.is('a')) $this = $this.removeclass('fancybox').find('a'); $this.addclass('fancybox').attr('rel', 'gallery').fancybox({ /* begin fancybox options */ width: 'auto', height: 'auto', autosize: true, aspectratio: true, fittoview: true, autocenter: true, scrolling: 'no', onclosed: function() {api.revresume()} }).on('click', function() {api.revpause()}); });
});
thanks
fancybox v3 uses data-fancybox
attribute grouping instead of rel
.
so, replace
.attr('rel', 'gallery')
with
.attr('data-fancybox', 'gallery')
simple demo - https://codepen.io/anon/pen/jyyryd?editors=1010
btw, v3 not have these options using , afterclose
callback used instead of onclosed
Comments
Post a Comment