将脚本文件加载到 Colorbox 以利用 JS 文件中的点击事件

问题描述

我正在使用 colorBox 插件显示轮播小部件的图像。我有两个按钮 addremoveadd 正在使用 colorBox onClosed 回调来添加图像,我想删除使用相同的回调并删除图像,但我无法在此处使用这些按钮的单击事件,因为这些按钮已加载到具有相应 JS 文件的另一个模块中。我的问题是我是否可以在此处加载该 JS 文件以在此处使用这些点击事件

             $.colorBox({
                href: url,iframe: true,reposition: true,width: "90%",height: "90%",onLoad: function() {
                    // hide the scrollbars from the main window
                    $('html,body').css('overflow','hidden');
                    //$('#cBoxClose').remove();
                },onClosed: function() {
                    if(addclicked){command 1}
                 else(removeclicked){command2}

                }
            });

addclickedremoveclicked 在其他模块中可用。我希望在 colorBox 中使用这些事件来运行 addremove 功能。任何人都可以为此提供解决方案吗?提前致谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)