将colorbox添加到带有url内容的动态创建的项目中

我正在尝试将颜色框添加到动态创建的对象中,它在第一次单击时起作用,但在第二次单击后不会打开,我不知道该怎么做。 我想知道我是不是以某种方式关闭了彩盒,或者它是否挂在后台……

$(".login").live('click', function(){ $.fn.colorbox({href:"http://ww.website/Login.html", open:true}); }); 

试试这个:

 $(".login").live('click', function(){ $.colorbox({ href:'http://threadless.com', iframe:true, width:"80%", height:"80%" }); }); 

要么

 content.on('click', '.login', function(){ $.colorbox({ href:'http://threadless.com', iframe:true, width:"80%", height:"80%" }); }); 

演示: http : //jsfiddle.net/F5jGQ/

我想你应该打电话给:

 $(".login").live('click', function(){ $.colorbox({href:"http://ww.website/Login.html", open:true}); });