将颜色框添加到具有url内容的动态创建项目 [英] add colorbox to dynamicly created item with url content

查看:107
本文介绍了将颜色框添加到具有url内容的动态创建项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试向动态创建的对象中添加一个颜色框,该颜色框在第一次单击时有效,但在第二次单击后无法打开,我不确定该怎么做.我想知道我是否会以某种方式关闭彩盒,或者它是否挂在背景中...

I'm trying to add a colorbox to a dynamicly created object, it works on the first click but won't open after the second one, I'm not sure what to do. I'm wondering if I'm not closing the colorbox somehow or if its hanging in the background...

    $(".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%" });
});

OR

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

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

这篇关于将颜色框添加到具有url内容的动态创建项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆