我正在使用 wall.plasm.it 并想使用 slimbox 全屏打开图像http://www.digitalia.be/software/slimbox
但是当我将 slimbox 脚本添加到我的网站并单击图像时,它只会打开图像并将我重定向到服务器上的图像,但不会启动 slimbox
我正在使用 wall.plasm.it 并想使用 slimbox 全屏打开图像http://www.digitalia.be/software/slimbox
但是当我将 slimbox 脚本添加到我的网站并单击图像时,它只会打开图像并将我重定向到服务器上的图像,但不会启动 slimbox
添加“单击”事件处理程序并使用 getMovement 函数。
items.each(function(item) {
item.addEvent("click",function(e){
if( wall.getMovement() ){
e.stop();
}
else {
Mediabox.open(...);
}
}); }
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);
});