gpt4 book ai didi

jquery - 是否可以在不关闭父级的情况下从另一个颜色盒打开颜色盒?

转载 作者:行者123 更新时间:2023-12-01 06:35:02 25 4
gpt4 key购买 nike

所以,是的,就像标题中所述,我正在尝试从颜色盒内打开另一个颜色盒,而不关闭它。可能吗?

我像这样打开主窗口:

$("#popup").colorbox({fastIframe: false});

#popup 链接到另一个页面(使用 yii 框架,因此它呈现 View )。现在在该颜色盒内,我有另一个按钮,它应该打开另一个带有一些额外信息的颜色盒。我尝试将 href 属性添加到 colorbox 本身:

$("#extra").colorbox({width:"600px", overlayClose:true, href:"<?php echo "/game/extra/id/" . $question->id ?>"});

但我没有运气,新内容显示在原始颜色框中。

最佳答案

Is it possible to open colorbox from another colorbox without closing the parent?

对您标题中问题的简短回答:不,如果您没有自己重写 colorbox 插件,则不会。

引自 Topher Fangio Multiple Jquery modal Dialog Boxes in one page?

Many modal dialog boxes have the ability to insert data into the modal dialog by use of an iFrame. I'm not sure which plugin you are using (or the built-in jQuery ones I guess) but I'm fairly certain that it allows you to have one modal dialog whose content changes based on what was clicked.

如果您没有注意到,已经存在许多相同的问题了

How to have multiple jQuery colorboxes in the same page

大多数答案是否定的。以下引用自 Jack jQuery ColorBox real multiple instances

I don't think there is going to be a practical way to do this. You would have to re-code a lot of the plugin for it to support multiple instances.

You may be able to keep your iframes as different pieces of inline content. I'm not sure if moving an iframe around the DOM will cause it to lose it's scrolltop position or not.

我不会认为这是一个答案,但只是想在您希望 jQuery 插件能够支持多个实例时指出正确的方向

您可以在这里找到它作为开头

5. Multi-Show/Hide -- a. view (show all), b. view (hide all), c. view (show+hide some)

关于jquery - 是否可以在不关闭父级的情况下从另一个颜色盒打开颜色盒?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18462317/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com