0
我试图为Fancybox搭建一个Knockout绑定(尽管我不认为这里涉及太多)。我基于从样品这里的代码中调用的fancybox:http://jsfiddle.net/STgGM/Fancybox 2调用时不显示.open()
$.fancybox.open([{
href: value.image(),
title: value.title()
}], {
padding: 0
});
长相方式通的对象:
{href: "http://example.com/imageurl", title: "Image Title"}
步进通过的fancybox代码,它捞出试图展示脚本线855周围的图像:
if (!type) {
F.coming = null;
//If we can not determine content type then drop silently or display next/prev item if looping through gallery
if (F.current && F.router && F.router !== 'jumpto') {
F.current.index = index;
return F[ F.router ](F.direction);
}
return false;
}
我不完全确定它在这一点上寻找什么。 F.current
为空,并且F.router
在对象上不存在。
因此,简而言之,我试图从一个链接点击触发Fancybox,而无需修改我的标记,或者在特定元素上调用.fancybox()
。这似乎是可能的,但它似乎并没有为我工作。
是'image()'你创建的函数吗?如果是的话你可以粘贴代码? – JFK