0
我想模仿他們設置他們的例子庫預覽的方式。他們在fancybox調用中將靜態圖像構建爲一個數組。我一直試圖用隱藏div $("#imgGallery").html()
替換該數組,其中包含引號和所有內容。但無法讓fancybox出現。fancybox畫廊傳遞元素內容作爲數組
如何將$(「#imgGallery」)。html()內容作爲數組傳遞給$ .fancybox()調用。
$("#manual2").click(function() {
$.fancybox([
'http://farm5.static.flickr.com/4044/4286199901_33844563eb.jpg',
'http://farm3.static.flickr.com/2687/4220681515_cc4f42d6b9.jpg',
{
'href' : 'http://farm5.static.flickr.com/4005/4213562882_851e92f326.jpg',
'title' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit'
}
], {
'padding' : 0,
'transitionIn' : 'none',
'transitionOut' : 'none',
'type' : 'image',
'changeFade' : 0
});
});
給你imgGallery div的例子。 – kwicher