私はこのようなものが必要でした。
ネットとjsfiddleについて調査し、修正してこのコードを思いついた。
ワーキングデモ
$(".fancybox").find("img").stop(true, true).animate({
"opacity": 0.2
}, "slow");
$(".fancybox").on("mouseenter", function () {
$(this).find("img").stop(true, true).animate({
"opacity": 1
}, "slow");
}).on("mouseleave", function () {
$(this).find("img").stop(true, true).animate({
"opacity": 0.2
}, "fast");
}).fancybox({
padding: 0,
openEffect: 'elastic',
openSpeed: 250,
closeEffect: 'elastic',
closeSpeed: 450,
closeClick: false,
helpers: {
overlay: {
css: {
'background': 'rgba(0, 0, 0, 0.9)'
}
}
}
});
ファンシーボックスプラグインを使用しています。
私はすでに返信が遅れているかもしれませんが、同じクエリを探している誰かを助けるかもしれません。