views:

15

answers:

2

I've added the Overlay effect of jQuery Tools to my site, using the "Minimum Setup". Unfortunately when the user wants to close it, he must target this tiny circle on the upper right. Usability suffers this way. It would be far better if the user could simply click anywhere to close it.

Can I modify or add some code so it would close the overlay no matter where to user clicks? Or maybe when he clicks outside of the overlay? I couldn't find any notes on that in the docs.

A: 

Try (quick and dirty):

$(document).click(function(){
    $('.simple_overlay:visible .close').click();
});
BGerrissen
+2  A: 

Or maybe when he clicks outside of the overlay?
Check the docs ('Configuration' part):

closeOnClick (default: true)
By default, overlays are closed when the mouse is clicked outside the overlay area. Setting this property to false suppresses this behaviour which is suitable for modal dialogs.

I.e., this functionality is already enabled by default. If it's not working, you might want to show us your overlay configuration.

Nikita Rybak
+1 guess I was being lazy not looking at the docs :p
BGerrissen
@BGerrissen I just happend to use this package recently, so I already knew where to look :)
Nikita Rybak
Did exactly what they did here: http://flowplayer.org/tools/demos/overlay/index.html - doesn't close at all by default when clicking outside the overlay. At least not on their own example site ;)
BugAlert
@BugAlert It seems you're right, but it works on [this example](http://flowplayer.org/tools/demos/overlay/styling.html) and on several others.
Nikita Rybak