【发布时间】:2015-12-23 02:30:12
【问题描述】:
我正在尝试在 Instafeed.js 图像上设置 jQuery Colorbox。 这两个脚本单独工作都很好,但每当我尝试将颜色框类设置为 Instafeed.js 模板部分中的元素时,颜色框就不再工作了。
但是,Colorbox 在 Instafeed 脚本之外正常工作,无论是 Colorbox 类设置为 <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 是否有特定的操作?我已经尝试了所有我能做的事情,网上并没有太多关于它的内容。
【问题讨论】:
标签: javascript jquery colorbox instafeedjs