嗨,我使用magnific彈出圖像庫,當圖像放大時我想隱藏div並在圖像縮小時再次顯示。這是我的代碼:當magnific popup開啓時隱藏div
$('.gallery-item').magnificPopup({
type: 'image',
gallery:{
enabled:true
},
mainClass: 'mfp-with-zoom', // this class is for CSS animation below
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');
}
}
});
我應該在哪裏放置隱藏()和show()函數,使他們將被觸發同時與莊重彈出。
在CSS中沒有隱藏的值顯示。請發佈您的完整代碼或提供演示。 – Alex