2013-02-16 18 views
0

目前使用的fancybox顯示這個prototype故障使用縮略圖幫手的fancybox

收藏畫廊觸發的fancybox(包括縮略圖助手),但不能讓他們顯示,當我用下面的jQuery。有任何想法嗎?

$(document).ready(function() { 
    $(".fancybox").fancybox({ 
     type: "image", 
     helpers: { 
      title: { 
       type: 'inside' 
      }, 
      buttons: {}, 
      thumbs: { 
       width: 50, 
       height: 50 
      } 
     }, 
     afterLoad: function() { 
      this.title = '' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : ''); 
     } 
    }); 
}); 

回答

4

您是否知道您還需要包含fancybox-thumbs .js和.css文件?像:

<link rel="stylesheet" href="./helpers/jquery.fancybox-thumbs.css" type="text/css" media="screen" /> 
<script type="text/javascript" src="./helpers/jquery.fancybox-thumbs.js"></script> 

....(檢查你設置自己的正確路徑),否則你永遠不會讓他們工作。

它們在下載的子目錄helpers/下。

+0

嘿,哇,認爲這是包括在Fancybox的縮小版本。我會檢查出來的,謝謝! – mtthwbsh 2013-02-16 22:45:00

+0

這讓我感到困惑 - 完全錯過了拇指和按鈕的額外文件!除非助手文件包含在主要的fancybox包含中,否則它們都不會起作用! – 2015-04-16 14:32:23