将颜色框中的选择传递给父对象

Pass selection from Colorbox to parent

本文关键字:对象 选择 颜色      更新时间:2023-09-26

我在其中一个表单中使用Colorbox模态进行图像选择。有没有一种方法可以动态地将图像选择传递到颜色框之外,然后关闭颜色框?

我一直在StackOverflow上搜索,但我找不到其他人试图实现同样的目标。

我想明白了。在将Jquery添加到Colorbox中加载的文件后,我可以使用window.parent.$("#select").after('<input type="hidden" name="image" value="' + img + '">');