jQuery ColorBox真正的多个实例 [英] jQuery ColorBox real multiple instances
问题描述
这个问题曾在Google网上论坛中问过,但从未得到真正的回答,该小组由ColorBox开发人员Jack Moore(令人惊叹的插件顺便说一句,谢谢!)关闭.
我想创建一个ColorBox灯箱的REAL多个实例.为了能够打开灯箱实例,然后在关闭它时,仅将其隐藏而不是将其从dom中移除.我开发了一个支持灯箱选项的Moodle活动模块.在我的课程页面中,我有ColorBox灯箱的多个实例(每个实例都包含一个iframe).当学生在打开的灯箱中浏览一本书或任何内容时,他关闭了该书,那么他以后必须能够以与书本关闭时相同的位置/状态再次打开它. /p>
我猜这不是标准功能,但是有人找到了一种方法吗?要保留colorbox实例/div,如果已经存在,以后再取消隐藏它即可?
您可以在关闭事件中调用新的颜色框.示例:
$.colorbox({
html:'test',
onClosed::function(){
// open the other colorBox
$.colorbox({html:'test'});
}
});
This question was asked before in a Google Group, but never really answered, and the group closed by the ColorBox developer Jack Moore (amazing plugin btw, thanks!).
I want to create REAL multiple instances of a ColorBox lightbox. This in order to be able to open a lightbox instance and then when closing it, only hiding instead of removing it from the dom. I developed a Moodle Activity Module that supports a lightbox option. And in my course page I have multiple instances of the ColorBox lightbox (each containing an iframe). When a student is browsing through a book, or whatever content, in the opened lightbox and he closes it, he later must be able to open it again with the book content in the same position/state as it was when he closed it.
I guess this is not a standard feature, but has someone found a way to do this? To keep the colorbox instance/div and, if it already exists, later just un-hiding it again?
You can call on close event new color box. Example:
$.colorbox({
html:'test',
onClosed::function(){
// open the other colorBox
$.colorbox({html:'test'});
}
});
这篇关于jQuery ColorBox真正的多个实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!