如何获得一个Fancybox错误或图像,它试图加载,但不能't

How to get an Fancybox error or href of image that it trying to load but can't?

本文关键字:加载 但不能 图像 何获得 一个 错误 Fancybox      更新时间:2023-09-26

标题中已经有问题了

下面是代码:

(function($){
        var filter = /(.*)('.jpg|'.png|'.gif|'.bmp)$/i;
        $('a > img').each(function(){
            var href = $(this).parent().attr('href');
            if ( filter.test(href) ){
                $(this).fancybox({
                    transitionIn:'fade',
                    transitionOut:'fade',
                    overlayShow:true,
                    overlayOpacity:0.7,
                    overlayColor:'#e8f1fa'
                });
            }
        });
    })($);

所以,正如你所看到的,目的是在序列"a> img"上设置一个花哨的盒子,其中"a "标签在图像上有链接。

这里是一个问题的地方:http://factorial.wispo.ru/novosti/skoro-budet-sajt.html

答案很简单——它需要在"A"标签上指定fancybox。所以,有一个修复:$(this).parent(). fanybox(…感谢focus and HAD