2014-10-04 120 views

回答

0

Fiddle Demo

使用afterShow而不是afterLoad

$(document).ready(function() { 
    $("#single_1").fancybox({ 
     helpers: { 
      title: { 
       type: 'float' 
      } 
     }, 
     afterShow: function() { //change here 
      $('.fancybox-image').loupe(); //apply loupe after popup has been shown 
     } 
    }); 
}); 

,并使用CSS

为你开放的fancybox弹出它的z-index是8010不允许loupe露面只是让它更高z-index:8020;,使其工作。

.loupe { 
    z-index:8020; 
} 
+0

'使用afterShow而不是afterLoad':复制/粘贴其他答案?导致OP似乎没有使用任何回调;) – JFK 2014-10-04 20:02:32

+0

@JFK OP先前发布了这个小提琴http://jsfiddle.net/svsdx/5439/一段时间后,他更新小提琴。没有复制粘贴。如果你不知道,不要责怪。 – 2014-10-04 20:57:11

+0

对不起,在OP问题中没有任何编辑的轨迹。这就是为什么我的评论(不是怪) – JFK 2014-10-04 22:02:36