selecto
selecto copied to clipboard
General Question: Do you have any examples available for regular vanilla JS
tried this but nothing happens...
<script type="module" src="js/selecto.min.js">
/* selecto */
import Selecto from "selecto";
const selecto = new Selecto({
// The container to add a selection element
container: document.body,
// Selecto's root container (No transformed container. (default: null)
rootContainer: root,
// The area to drag selection element (default: container)
dragContainer: div,
// Targets to select. You can register a queryselector or an Element.
selectableTargets: [document.getElementById("showCollections")],
// Whether to select by click (default: true)
selectByClick: true,
// Whether to select from the target inside (default: true)
selectFromInside: true,
// After the select, whether to select the next target with the selected target (deselected if the target is selected again).
continueSelect: false,
// Determines which key to continue selecting the next target via keydown and keyup.
toggleContinueSelect: "shift",
// The container for keydown and keyup events
keyContainer: window,
// The rate at which the target overlaps the drag area to be selected. (default: 100)
hitRate: 100,
});
selecto.on("select", e => {
e.added.forEach(el => {
el.classList.add("selected");
});
e.removed.forEach(el => {
el.classList.remove("selected");
});
});
</script>
@inglesuniversal
Is the example correct?
Do you have an address to test?
I will try to set up an example with a link to it. Thanks