4

I am using Slimbox 1.71 for MooTools 1.2 ( Demo )
I would like to close the expanded Image if I click on the expanded image itself.

How would I do that?

Community
  • 1
  • 1
dude
  • 41
  • 1

2 Answers2

2

Modifying the core script is bad practice (say you update the script - you'll lose your changes). It's actually better to add a code snippet after the library is loaded, and operational:

document.id('lbImage').addEvent('click', function(){
    document.id('lbCloseLink').fireEvent('click');
});
xpda
  • 15,585
  • 8
  • 51
  • 82
Oskar Krawczyk
  • 3,492
  • 17
  • 20
  • 1
    yeah, this is what happens when you write code that does not extend well. it's not a class, it has no events, makes it very hard to work with it. if it had been a class with onOpen / onClose events, all you would have had to do was pass on `onOpen: function() { this.something.addEvent("click", this.close.bind(this)) }` and be done with it... should really look at using something more recent. – Dimitar Christoff Apr 04 '11 at 14:26
0

Find:

id:"lbCenter"

Replace:

id:"lbCenter", events: {click: close}
Marcel
  • 27,922
  • 9
  • 70
  • 85