![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
selection-area
Advanced tools
Simple JavaScript mouse & touch seletion area to any DOM container element.
How to use | API Reference | Demo
npm
npm install selection-area
yarn
yarn add selection-area
Clone or download zipped source code into node_modules
project folder.
git clone https://github.com/lucasmenendez/selection-area.git <project>/node_modules/selection-area
Import using script
html tags with vendor path:
<script src="/node_modules/selection-area/dist/selection-area.js"></script>
Or import using ES6 import
:
import { SelectionArea } from 'selection-area';
Importing with unpkg.com:
<script src="https://unpkg.com/selection-area"></script>
Define container for selection area and selectable childs.
<div class="parent">
<div class="child">0</div>
<div class="child">1</div>
<div class="child">2</div>
<div class="child">3</div>
<div class="child">4</div>
<div class="child">5</div>
<div class="child">6</div>
<div class="child">7</div>
<div class="child">8</div>
<div class="child">9</div>
</div>
Define SelectionArea
behaviour with configuration
object, check available parameters here.
let config = {
container: document.querySelector('.parent'),
area: {
class: 'custom-area'
},
targets: '.child',
touchable: true,
autostart: true,
callback: selection => {
if (selection.length == 0) alert("empty selection");
else alert(`${ selection.length } items selected`);
}
}
let selectable = new SelectionArea(config);
Also you can stylize the selection area element adding style yo defined class.
.custom-area {
background: rgba(52, 152, 219, 0.2);
border: 2px dotted #2980b9;
}
FAQs
Simple JavaScript mouse & touch seletion area to any DOM container element.
The npm package selection-area receives a total of 18 weekly downloads. As such, selection-area popularity was classified as not popular.
We found that selection-area demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.