【发布时间】:2014-08-08 12:58:01
【问题描述】:
我想将 2 或 3 个颜色框堆叠在一起,但不像俄罗斯娃娃那样在彼此的范围内,更像是第一个覆盖 50% 的屏幕,第二个覆盖 100% 的屏幕,并且然后第三个再次覆盖 50% 的屏幕。
在here 的帮助下,我设法创建了效果,但问题是当我关闭颜色框时,所有当前打开的颜色框同时关闭。我想要关闭按钮来关闭那个颜色框。理论上人们会按顺序关闭它们,但我显然无法预测。
我认为这与 jquery 选择器关闭所有打开的颜色框有关。任何指针表示赞赏。
创建第一个颜色框的代码:
$.colorbox({iframe:true, width:width, height:height, scrolling: false, href:linkRef, fastIframe:false, onClosed:function(){$('#cboxClose').attr('class', '');}});
$('#cboxClose').attr('class', 'photomontageFrame');
创建第二个颜色框的代码:
window.parent.$.colorbox({iframe:true, width:width, height:height, scrolling: false, href:a, onClosed:function(){$('#cboxClose').attr('class', '');}});
window.parent.$('#cboxClose').attr('class', 'photomontageFrame');
谢谢
【问题讨论】:
-
是我遗漏了什么还是您没有提供任何代码/小提琴?
-
你说得对,我没有——太着急了
-
也许一个完整的 html 结构 + 你提供的代码,全部在小提琴中,会更好
标签: javascript jquery iframe colorbox