Get the App
SLTechnology News&Howtos  ›  Development  › 

Characteristics and usage of Selection Library in JS

Shulou Source: shulou.com Published: 2022-06-03 17:50:26 10月05日 Update

This article mainly explains "the characteristics and usage of Selection library in JS". The content of the explanation in this article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the characteristics and usage of Selection library in JS".

Selection is a simple lightweight library for visual DOM selection, such as on the desktop. There is no jQuery. Any css library, such as Bootstrap, is supported. Includes vertical and horizontal scrolling support.

Characteristics of selection

Support for touch devices

Easy to use

No jQuery.

Vertical and horizontal scrolling support

The usage of selection

Constoptions= {

/ / Allelementswiththeclass'selectable'selectable.

Selectables: ['.selectable']

}

Constselection=Selection.create (options)

Option

Constselection=newSelection ({

/ / Classfortheselection-area-element

Class:'selection-area'

/ / px,howmanypixelsthepointshouldmovebeforestartingtheselection

StartThreshold:10

/ / Disabletheselectionfunctionalityfortouchdevices

DisableTouch:false

/ / Onwhichpointanelementshouldbeselected.

/ / Availablemodesarecover (covertheentireelement), center (touchthecenter) or

/ / thedefaultmodeistouch (justtouchingit).

Mode:'touch'

/ / Enablesingle-clickselection (Alsodisablesrange-selectionviashift+ctrl)

SingleClick:true

/ / Queryselectorsfromelementswhichcanbeselected

Selectables: []

Thank you for reading, the above is the content of "the characteristics and usage of Selection library in JS". After the study of this article, I believe you have a deeper understanding of the characteristics and usage of Selection library in JS, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Features support learning content level that is ideas situations articles more desktops knowledge knowledge points articles devices follow lightweight lightweight problems practice Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Huawei Apple Docker macOS