好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

Selection.js

Selection.js 介绍

? 一个 简单轻量级的库,用于实现可视DOM选择,例如在桌面上。没有jQuery。 支持 任何css库,例如Bootstrap。 包括 垂直和水平滚动 支持 。?

特征

支持 触摸设备

用法 简单

没有jQuery

垂直和水平滚动 支持

安装

通过npmnpm install @simonwep/selection-js --save

用法

const options = {// All elements with the class 'selectable' selectable.selectables: ['.selectable']};const selection = Selection.create(options);

选项

const selection = new Selection({// Class for the selection-area-elementclass: 'selection-area',// px,how many pixels the point should move before starting the selectionstartThreshold: 10,// dis able the selection functionality for touch devices dis abl eto uch: false,// On which point an element should be selected.// Available modes are cover (cover the entire element),center (touch the center) or// the default mode is touch (just touching it).mode: 'touch',// Enable single-click selection (Also dis ables range-selection via shift + ctrl)singleClick: true,// Query selectors from elements which can be selectedselectables: [],// Query selectors for elements from where a selection can be startstartareas: ['html'],// Query selectors for elements which will be used as boundaries for the selectionboundaries: ['html'],// Query selector or dom node to set up container for selection-area-elementselectionAreaContainer: 'body',// On scrollable areas the number on px per frame is devided by this amount.// Default is 10 to provide a enjoyable scroll experience.scrollSpeeddivider: 10,// Will be called before the selection starts (mouse / touchdown). Can be used// to specify which action / mousebutton are needed to start the selection.validateStart(evt) {evt; // MouseEvent or TouchEvent// Return true to start the selection,false to cancel it.return true;},// Element selection stardet,see Events for detailsonStart(evt) {evt.selection;evt.eventName;evt.areaElement;evt.originalEvent;evt.selectedElements;evt.changedElements;},// Single-click selectiononSelect(evt) {// Same properties as onStartevt.target; // Clicked element},// Element selection moveonMove(evt) {// Same properties as onStart},// Element selection stoppedonStop(evt) {// Same properties as onStart},// Filter single elementselectionFilter(evt) {evt.selection; // This selection instanceevt.eventName; // The event nameevt.element; // The element which is in the current selection// return true to keep the element in the current selection}}); 链接 : http://www.fly63.com/nav/2164

网站地址 : https://simonwep.github.io/selection/

GitHub: https://github.com/Simonwep/selection

网站描述: 一个 用于制作可视化DOM选择的简单,轻量级和现代化的库

Selection.js官方网站

官方网站: https://simonwep.github.io/selection/

如果觉得 网站内容还不错,欢迎将 网站 推荐给程序员好友。

查看更多关于Selection.js的详细内容...

  阅读:30次

上一篇

下一篇

第1节:thinkPHP    第2节:johnny-five    第3节:Yii    第4节:WePY    第5节:ShareDB    第6节:RxJS    第7节:d3-dag    第8节:egg-react-ssr    第9节:Deep playground    第10节:Guess.js    第11节:hyperapp    第12节:Avalon.js    第13节:Inferno    第14节:HTTPie    第15节:ITPUB    第16节:dva    第17节:Quasar    第18节:graphql-yoga    第19节:Next.js    第20节:IronJS    第21节:mpvue    第22节:react    第23节:marked.js    第24节:SAPUI5    第25节:Neuro.js    第26节:enyo.js    第27节:wire.js    第28节:ui-router    第29节:vuera    第30节:tether    第31节:Mootools    第32节:graphql.js    第33节:flex.css    第34节:bacon.js    第35节:react-move    第36节:Mithril.js    第37节:Sugar.js    第38节:tabris.js    第39节:snabbdom    第40节:vuesion    第41节:anujs    第42节:Nautil    第43节:rax    第44节:Stencil.js    第45节:dio    第46节:compromise    第47节:crypto.js    第48节:imba    第49节:alt.js    第50节:svelte    第51节:react-sortable-hoc    第52节:react-snap    第53节:Fortune.js    第54节:Qatrix    第55节:KaTeX    第56节:preactjs    第57节:Lisk    第58节:Vanilla JS    第59节:es4x    第60节:styled-components    第61节:JustAuth    第62节:html2canvas    第63节:backbone    第64节:ml.js    第65节:virtual-dom    第66节:nw.js    第67节:umbrella.js    第68节:Walt    第69节:MXFlutter    第70节:FileSaver.js    第71节:Rivets.js    第72节:way.js    第73节:Flight.js    第74节:react-static    第75节:rethinkdb    第76节:Chromeless    第77节:i18next    第78节:Choo    第79节:jsMind    第80节:knockout.js    第81节:nuxt.js    第82节:Mpx    第83节:Vue    第84节:Meteor.js    第85节:Towxml    第86节:vue-resource    第87节:DefinitelyTyped    第88节:Aurelia    第89节:jsrender    第90节:Dahlia    第91节:tfjs-core    第92节:is.js    第93节:immer.js    第94节:STDLib    第95节:angular-seed    第96节:Cube.js    第97节:SproutCore    第98节:vecty.js    第99节:Maquette    第100节:Redux    第101节:Javascript Fun    第102节:moon    第103节:Ember    第104节:react-redux    第105节:falcor    第106节:normalizr    第107节:Automerge    第108节:PapaParse    第109节:LokiJS    第110节:Megalo    第111节:Selection.js    第112节:react-router    第113节:Manta    第114节:ccxt    第115节:CloudBoost    第116节:cool-admin    第117节:Vapper    第118节:ramda    第119节:Scala.js    第120节:limejs    第121节:Senna.js    第122节:fuelux    第123节:emotion    第124节:eeui    第125节:Riot.js    第126节:HooX    第127节:linaria    第128节:Keras.js    第129节:worker-dom    第130节:vite    第131节:Mermaid    第132节:Chameleon    第133节:quicklink    第134节:lovli.js    第135节:localForage    第136节:Cycle.js    第137节:Konva.js    第138节:ConvNetJS    第139节:IPFS    第140节:angular-dart    第141节:DojotoolKit    第142节:InversifyJS    第143节:cash    第144节:react-motion    第145节:hox    第146节:KISSY    第147节:mind.js    第148节:Leaflet.js    第149节:Omi    第150节:vue-router    第151节:graphql-js    第152节:vue-rx    第153节:asm-dom    第154节:weui.js    第155节:react-server    第156节:togetherjs    第157节:Duktape    第158节:Zebkit    第159节:MontageJS    第160节:Underscore.js    第161节:CanJS    第162节:Tesseract.js    第163节:sheetjs    第164节:Rocket    第165节:construct-js    第166节:rrweb    第167节:Neataptic    第168节:Flux    第169节:aframe    第170节:ThingJS    第171节:Midway    第172节:webdnn    第173节:Brain.js    第174节:UmiJs(五米)    第175节:reactxp    第176节:TensorFlow.js    第177节:Kbone    第178节:relay    第179节:H-ui    第180节:AngularJS    第181节:after.js    第182节:Dojo    第183节:jsoneditor    第184节:react-360    第185节:truffle    第186节:ale.js    第187节:pico.js    第188节:PathFinding.js    第189节:NodeList.js    第190节:interact.js    第191节:Immutable.js    第192节:cell    第193节:QuoJS    第194节:zepto.js    第195节:flutter-desktop-embedding    第196节:fre.js    第197节:Razzle    第198节:ocLazyLoad    第199节:eventproxy    第200节:vuex    第201节:angularfire2    第202节:socket.io    第203节:SkateJS    第204节:polymer    第205节:Electron    第206节:Nerv    第207节:Mind elixir    第208节:PeerJS    第209节:React Router    第210节:joi    第211节:single-spa    第212节:workbox    第213节:san    第214节:apify-js    第215节:Bootstrap    第216节:Angular    第217节:QucikUI    第218节:Expressjs    第219节:ThinkJS    第220节:Nest JS    第221节:Laravel    第222节:CodeIgniter    第223节:Zend Framework    第224节:CakePHP    第225节:Symfony    第226节:StartMVC