Selection.js

编程之家收集整理的这个编程导航主要介绍了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,// Disable the selection functionality for touch devicesdisableTouch: 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 disables 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全部内容。

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


johnny-five,Bocoup 的 JavaScript 机器和物联网编程框架
WePY,一款让小程序支持组件化开发的框架
Deep playground,神经网络的交互式可视化,使用d3.js和TypeScript编写
ShareDB,用于并发编辑系统的前端数据库
RxJS,RxJS 是使用 Observables 的响应式编程的库
egg-react-ssr,最小而美的Egg + React + SSR 服务端渲染应用骨架
Avalon.js,迷你, 易用 ,高性能 的前端MVVM框架
d3-dag,用于可视化有向无环图的布局算法
Guess.js,Google的数据驱动改进前端体验的工具库
hyperapp,创建前端应用的 1 KB 的 JavaScript 库
ITPUB,中国专业的IT技术社区
HTTPie,一个 HTTP 的命令行客户端工具
Inferno,快速、类React风格的js用户界面库
Quasar,基于Vue构建响应式网站和混合移动端 APP
dva, 基于 React 和 redux 的轻量级框架配合 umi 使用后更是降低为 0 API
graphql-yoga,graphql-yoga 全功能的GraphQL服务器,专注于简单的设置,性能和卓越的开发者体验
Next.js,实现react的服务端渲染的框架
IronJS,一个.NET的JavaScript实现
mpvue,基于 Vue.js 的小程序开发框架
react,Facebook开发的一款高效、灵活、声明式设计的JS库