我使用api从flickr动态加载图像。但是,当我尝试使用colorbox,prettyphoto或其他jquery模式窗口 - 它们不起作用。到较大图像的链接仅在新窗口中打开图像。jquery模式插件不能用于动态加载的图像
我的测试页: http://www.thinquetanque.com/test/full/test.html#/advanced-usage
我假设图象已被拉扯之前它是由于模态插件的加载。
想法如何抵消?
谢谢!
更新:
尝试使用:
$('.colorbox').live('click', function() { $.fn.colorbox({href:$(this).attr('href'), open:true}); return false; }
这并不工作 - 但我想我的Flickr API中使用 - 使用.live如下建议。我正在使用的flickr api使用.live为div的子元素添加属性。
$('#wrapper').live('mouseover', function(){
$(this).children('p').attr('class', 'image-info');
});
但我无法弄清楚如何改变上面的使用colorbox。我改变了鼠标悬停点击,但我不知道如何使用$(this).children添加colorbox功能
我想下面的 - 但没有运气--- $活( '点击 '函数(){$ .fn(' 颜色框。')。 .colorbox({href:$(this).attr('href'),open:true}); return false; } – Jason 2011-02-28 00:25:58