0

我的应用程序中有一个灯箱 (YUI)。通过使用右上角的“x”关闭此灯箱后,我需要执行一组操作。为此,我需要捕获关闭灯箱时触发的事件。有人可以帮忙吗?注意 - 我在网上做了一些研究,甚至浏览了 YUI js 文件,但找不到解决方案。

4

2 回答 2

0

有可能做这样的事情:

Y.one('#buttonNavClose').on('click', doSomething);

buttonNavClose 是关闭按钮节点的 id。

于 2013-06-25T07:36:01.723 回答
0

不幸的是,YUI Gallery 中的 Lightbox 模块已经过时了,它没有使用任何 YUI 组件来让您对关闭的灯箱做出反应。我建议您使用与 Lightbox 非常相似的AUI 的 ImageViewer 组件。它允许您像这样收听表示查看器关闭的事件:

YUI().use('aui-image-viewer', function(Y) {
  var imageViewer = new Y.ImageViewer({
    links: '#gallery a'
  });
  imageViewer.render();
  imageViewer.on('visibleChange', function (Y) {
    // if e.newVal is false, then the image viewer is being hidden
    if (!e.newVal) {
    }
  });
});
于 2013-06-23T20:01:04.787 回答