我想将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');


谢谢

最佳答案

我认为您的问题不是iframe,而是colorbox仅支持一个实例的事实。它似乎也很旧,不支持jQuery的最新版本。我会寻找一个不同的插件。

09-17 01:33