views:

237

answers:

1

I am using the jQuery UI Slectable http://jqueryui.com/demos/selectable/

Once initialized (just like in the demo on that link). drag-selecting only works if I start holding the mouse button on top of a object. If I start drag-selecting from outside of the objects, the selecting does not work.

Is there any way to enable it so the user can initiate the drag-selecting outside of the Selectable objects?

+2  A: 

The mouse event listener in the 'selectable' is bound to the wrapper element that you have attached it to. By attaching the it to the body and providing a filter you can get what you're looking for.

Based on the jQuery example:

$('body').selectable({ filter: '#selectable li' });

*Edit: Unfortunately because of this._trigger("stop", event); it will stop other events on the page.

Your best solution might be to just make the wrapper around the selectables larger.*