selection一个简单轻量级的库,用于实现可视DOM选择,例如在桌面上。没有jQuery。支持任何css库,例如Bootstrap。包括垂直和水平滚动支持。
selection的特征
支持触摸设备
用法简单
没有jQuery
垂直和水平滚动支持
selection的用法
constoptions={
//Allelementswiththeclass'selectable'selectable.
selectables:['.selectable']
};
constselection=Selection.create(options);
选项
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:[],
上一篇:怎么使用ndm
下一篇:js中怎么截取字符串的某一部分