我是jquery的新手,除其他外,所以我爲無知道歉。我無法弄清楚爲什麼這個腳本不會影響任何東西。我點擊縮略圖,就可以看到一個全圖,沒有花哨的新頁面。我檢查了腳本鏈接(這裏沒有顯示),它們看起來是正確的,所以我認爲這個代碼不能以某種方式有效。有趣的是這一切都與早期版本的FancyBox一起使用。請幫助,並讓我知道是否需要更多信息才能給出答案。謝謝。Fancybox jQuery,簡單的錯誤大概
<script type="text/javascript">
$(document).ready(function() {
$("a.projectgallery").fancybox({
'transitionIn' : 'fade',
'transitionOut' : 'fade',
'titlePosition' : 'over',
'titleShow' : 'true',
'overlayShow' : 'true',
'overlayColor' : '#fff',
'overlayOpacity' : '0.9',
'showNavArrows' : 'true',
'enableEscapeButton' : 'true',
'scrolling' : 'no',
'onStart':function(currentArray,currentIndex,currentOpts){
var obj = currentArray[ currentIndex ];
if ($(obj).next().length)
this.title = $(obj).next().html();},
'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
return '<span id="fancybox-title-over">' + title + '</span>';
}
});
});
</script>
如果您使用Firebug,請單擊Persist並檢入它,以查看是否收到任何錯誤 –
$(「a.projectgallery」)。fancybox不是函數 [Break On This Error]'titleFormat':function title,currentArray,currentIndex,currentOpts){ – 4rederick
但是titleFormat是不是一個函數?根據http://fancybox.net/api,它是。 ? – 4rederick