2011-07-12 16 views
0

題目中已有問題。如何獲得它嘗試加載但不能加載的Fancybox錯誤或圖像的href?

下面是一個代碼:

(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' 
       }); 
      } 
     }); 
    })($); 

所以,你可以看到,在這樣做的目的設立的fancybox上的序列「一> IMG」,其中「A」標籤有一個鏈接圖片。

這是一個問題的地方:http://factorial.wispo.ru/novosti/skoro-budet-sajt.html

+0

Lol!答案很簡單 - 它需要在「A」標籤上指定fancybox。 ,有一個修正:$(this).parent()。fancybox(...感謝關注和HAD。 –

回答

0

答案很簡單 - 它需要指定的「A」標記的fancybox。所以,有一個修正:$(this).parent()。fancybox(...感謝您的關注和HAD

相關問題