【发布时间】:2015-04-30 06:46:46
【问题描述】:
我正在为画廊使用magnific-popup 插件,并且我使用fonts-awesome 字体中的箭头更改了默认箭头样式,但是在打开画廊并开始单击右/左箭头后,在特定区域中弹出窗口关闭。 . 这里jsfiddle演示
$('.related-gallery').magnificPopup({
type: 'image',
gallery:{
enabled:true,
arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow custom-mfp-arrow-%dir%"><i class="fa fa-angle-%dir% fa-4x"></i></button>'
},
zoom: {
enabled: true, // By default it's false, so don't forget to enable it
duration: 300, // duration of the effect, in milliseconds
easing: 'ease-in-out', // CSS transition easing function
// The "opener" function should return the element from which popup will be zoomed in
// and to which popup will be scaled down
// By defailt it looks for an image tag:
opener: function(openerElement) {
// openerElement is the element on which popup was initialized, in this case its <a> tag
// you don't need to add "opener" option if this code matches your needs, it's defailt one.
return openerElement.is('img') ? openerElement : openerElement.find('img');
}
}
});
【问题讨论】:
标签: jquery css magnific-popup