0

我正在使用 wall.plasm.it 并想使用 slimbox 全屏打开图像http://www.digitalia.be/software/slimbox

但是当我将 slimbox 脚本添加到我的网站并单击图像时,它只会打开图像并将我重定向到服务器上的图像,但不会启动 slimbox

4

3 回答 3

0

添加“单击”事件处理程序并使用 getMovement 函数。

items.each(function(item) {
item.addEvent("click",function(e){
if( wall.getMovement() ){
    e.stop();
    }
    else {
            Mediabox.open(...);
    }
}); }
于 2012-04-16T04:27:19.967 回答
0

I think you need to use Event Delegation - this is how I got my wall working with lightbox. I called this after the initWall() method and also the changeOnUpdate() so the new events would be added.

var boundClicker;   


          $$('div.tile a').each(function(button) {


              var linkDest = button.get('href');
              var title = button.get('data-title');
              var type = button.get('rel');

              var clicker = function(event)
              {
                  event.stop();
                  Mediabox.open(linkDest, title, '470 290');
              };
              boundClicker = clicker.bind(button);
              button.addEvent('click', boundClicker);

           });
于 2012-01-19T01:41:47.363 回答
0

啊,看来您必须执行以下操作:

  1. 使用wall.setCallOnUpdate( myFunctionUpdate );( this ) 更新所有新生成的图像,以便它们具有 rel=lightbox 属性集。
  2. 重新初始化 slimbox。

- 或者 -

您可以简单地使用APICallOnUpdate直接在项目上启用 slimbox

于 2011-11-18T16:03:28.087 回答