Javascript 使用$.fancybox()语法将选项传递给fancybox v2
我正在用Fancybox做一些非常定制的事情,并将一组新的图像传递给它使用Javascript 使用$.fancybox()语法将选项传递给fancybox v2,javascript,jquery,fancybox,Javascript,Jquery,Fancybox,我正在用Fancybox做一些非常定制的事情,并将一组新的图像传递给它使用 $.fancybox(galleryList); // This works 其中galleryList是图像对象的数组 问题是,我还必须向它传递一个自定义索引选项 $(galleryList).fancybox({ // This does not work index : imgIndex }); 其中imgIndex是一个非负整数。找到了 $.fancybox(galleryList, { in
$.fancybox(galleryList); // This works
其中galleryList是图像对象的数组
问题是,我还必须向它传递一个自定义索引选项
$(galleryList).fancybox({ // This does not work
index : imgIndex
});
其中imgIndex是一个非负整数。找到了
$.fancybox(galleryList, {
index: imgIndex
});