SoFunction
Updated on 2025-03-01

js simulation computer selection multi-folder effect_selected area code

The code is simple and will continue to be improved. . .
Hold down the mouse button and drag the mouse to see the effect

[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]

update:
1. For the first two beta versions, this version fixed the bugs that occurred in the first two versions.
2. Simple encapsulation of the code (because I am a beginner and have a shallow mastery of js, so my object-oriented understanding is very poor and the encapsulation is not good);
3. Added support for Ctrl and Shift keys (currently, the function of shift key is the same as that of ctrl key, and it cannot achieve the function of imitating the selection of the Shift key in Windows).
4. Added the method to get the "Selected Element" and you can click the button "getRegions" to see the effect.
Calling method:
Copy the codeThe code is as follows:

new RegionSelect({
region:'',
selectedClass: 'seled'
}).select();

Enhanced effect code

[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]