我正在尝试在 Instafeed.js 图像上设置 jQuery Colorbox。这两个脚本分别工作正常,但每当我尝试将颜色框类设置为 Instafeed.js 模板部分中的元素时,颜色框不再工作。
但是,Colorbox 在 Instafeed 脚本之外正常工作,无论是 Colorbox 类设置为 an<a>
还是<img>
。
Instafeed
var userFeed = new Instafeed({
get: 'user',
userId: ,
limit: 20,
accessToken: '',
resolution: 'standard_resolution',
template: '<a href="{{model.images.standard_resolution.url}}" class="box"><img src="{{image}}" /></a>',
});
userFeed.run();
彩盒
$(document).ready(function(){
$(".box").colorbox({transition:"fade"});
});
这里有同样的问题:https ://github.com/stevenschobert/instafeed.js/issues/198但给出的解决方案由于某些原因不起作用。使用此解决方案,当我单击图像时没有任何反应。使用帖子中显示的我之前的代码,它在不同的窗口中打开了图像。
将 Colorbox 设置为 Instafeed 是否有特定的操作?我已经尽我所能,网上没有太多关于它的内容。