dude
dude

Reputation: 41

how to modify slimbox to close by clicking on expanded image

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?

Upvotes: 4

Views: 608

Answers (2)

Oskar Krawczyk
Oskar Krawczyk

Reputation: 3502

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');
});

Upvotes: 2

Marcel
Marcel

Reputation: 28087

Find:

id:"lbCenter"

Replace:

id:"lbCenter", events: {click: close}

Upvotes: 0

Related Questions