我用颜色框的iframe:如何关闭颜色框与按钮
$(document).ready(function(){
$(".iframe").colorbox({iframe:true, width:"85%", height:"65%", fastIframe:false});
});
在我的第二个页面我有一个按钮,在这里我想发布一些图像和行动后,我想关闭框架窗口。
<input type="button" id="selected" value="the_button" />
和脚本
$(document).ready(function() {
$("#selected").bind('click',function() {
window.setTimeout(function()
{
$.colorbox.close();
}, 2500);
alert('hi');
});
});
谢谢,@Ares,但我尝试这一点,并没有帮助。 我也尝试 $( “#选择”)点击(函数(){ \t \t parent.jQuery.colorbox.close();返回false; \t \t }); 它显示错误“权限被拒绝访问属性'jquery'” – onlinepch 2013-03-14 15:04:39
如果我评论“parent.jQuery.colorbox.close();返回false;” 并把“alert('hi');”它显示正确,没有错误。 – onlinepch 2013-03-14 15:15:28
什么是html标签#selected是? – Ares 2013-03-14 15:45:14