Get all elements under a mouse drag selection in javascript

From Code Trash
Jump to: navigation, search

Hi, You guys would have seen the image cropping tool which has a selection option (marque tool) created in javascript. Like this i want to get all elements under a selection.

For example in windows we have mouse group selection of files and folders by dragging the mouse to select multiple files. Like that i need to get all the elements under a selection in javascript. I can try other gimmicks but if there could be a simple tool then i can speed up my work. javascript jquery link|flag

asked Apr 2 at 5:56 Jayapal Chandran 11

and finally i have got the answer with other discussions. that is... Do a drag start and drag stop of your mouse and note the left top of drag start and right botton of drag stop. now it is the rectangle from which i wants the elements. So i got the coordinates of the mouse selection and then... get all elements left and top properties and compare with the coordinates of the mouse selection to check whether the elements is inside the boundary...

To have a visible selection option we can have our own marque tool which is another discussion of how to create one.

may be i will try... but i would like to implement my own code... what if without jquery... so just a ping... anyway... this would help for the current moment...

have a look at the selectable ui , does exactly that lol ...

answered Apr 2 at 13:10 Val 506112