🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

js-tap

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

js-tap

a tap plugin

unpublished
Source
npmnpm
Version
1.2.3
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

tap npm npm

a tap plugin

Install

$ npm install --save js-tap

Usage

var tap = require('js-tap');

//直接调用
tap('.test',function(){
  console.log(this);
})

//事件委托
tap(document,'.test',function(){
  console.log(this);
})

//阻止事件冒泡/默认动作
tap('.test',function(e){
  e.stopPropagation();
  e.preventDefault();
})

//同时指定多个事件
tap(document,{
 '.el1':function(){
   //事件1
 },
 '.el2':function(){
  //事件2
 },
 '.el3':function(){
  //事件3
 }
})

Demo

demo page

Update

2018.1.24(update)

  • 增加同时指定多个事件方式

2018.1.23(update)

  • 事件委托可以使用document
  • 返回touchend或click事件,可手动进行阻止冒泡等其他操作

2018.1.17(publish)

  • 发布至github及npm(js-tap)
  • 可以直接调用及通过事件委托调用
  • 增加阻止事件冒泡功能

Keywords

tap

FAQs

Package last updated on 11 Feb 2018

Did you know?

Socket

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.

Install

Related posts