Skip to content

use for prevent browser default behavior. usually used in web without scroll app.

License

Notifications You must be signed in to change notification settings

jameshsu1125/lesca-click

Repository files navigation

React React React React React NPM React NPM

Why use it?

use for prevent browser default behavior. usually used in web without scroll app.

Installation

$ npm install lesca-click --save

Demo

Live Demo

Usage

import Click from 'lesca-click';

Click.install();

Click.add('.target', (e) => {
  console.log('target clicked');
});

// find single className only
<div class='target'> // good
<div class='target on'> // bed

Methods

method options type description default
.install() install true
add(target, execution) target string selector => ".target" or "#target"
execution function call when target clicked
remove(target) target string selector => ".target" or "#target"
clear() clear all functions
setPreventDefault(value) value boolean set preventDefault enable or disable
addPreventExcept(target) target string ".target" or "#target"

Features

  • maintain if necessary

About

use for prevent browser default behavior. usually used in web without scroll app.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published