https://github.com/abdullah/selo
This repository contains of text selection custom event.
https://github.com/abdullah/selo
Last synced: 4 months ago
JSON representation
This repository contains of text selection custom event.
- Host: GitHub
- URL: https://github.com/abdullah/selo
- Owner: abdullah
- Created: 2016-08-28T18:22:59.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-10-31T13:32:42.000Z (over 9 years ago)
- Last Synced: 2024-12-19T16:03:20.148Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 21.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
##Selo
Selo is a trigger **end** of the custom selection text and fires event. [see](https://developer.mozilla.org/en-US/docs/Web/Events/selectionchange)
####İnstall
```npm i selo -S```
##Set properties & Use
```
//or
var Selo = require('selo');
//or
import Selo from 'require'
var Selo = new Selo({
log:false,
els : '.arena'
});
document.addEventListener('selectionEnd',function () {
console.log("End",Selo.getPositionRange())
document.querySelector('span').innerText = "End"
})
document.addEventListener('selectionStart',function () {
console.log("Start")
document.querySelector('span').innerText = "Start"
})
document.addEventListener('selectionBeforeStart',function () {
console.log("Before Start")
document.querySelector('span').innerText = "Before Start"
})
```