[单击缩略图时,FancyBox会放大该图像,但是我想做的是将正在放大的图像替换为另一图像。
<map>
<area shape="poly" coords="453,862,477,862,478,899,453,900" href="/Images/main.jpg" alt="333" />
</map
$('area').fancybox({
beforeLoad: function(instance){
//change href to something like "/Images/main_333.jpg"
// the idea is to grab the alt tab number and then add it to the href string to get the correct image
}
});
这里是如何更改URL的示例:
$('[data-fancybox="images"]').fancybox({
beforeLoad : function(instance, current) {
current.src = 'https://loremly.com/640x480/';
}
});