mercredi 4 mars 2009

Handling clicks outside a specified area in jQuery

Recently I’ve needed to handle clicks in jQuery which occur anywhere inside a page but outside a specified area. I’ve been working on a drop down list control which contains a list of checkboxes. The list of checkboxes is shown and hidden by clicking the preceding h4 title, mimicing the functionality of an ordinary drop down list. I wanted to extend this functionality to hide the list when the user clicked anywhere outside the containing div. Here’s the markup for my control:

pour plus de détails :
http://rob-bell.net/2009/02/handling-clicks-outside-a-specified-area-in-jquery/

Aucun commentaire: