Git Product home page Git Product logo

trigger-event's Introduction

trigger-event

Trigger native DOM events. This is primarily useful for testing, or for triggering common DOM events such as the change event for custom components.

Installation

component install adamsanderson/inline-edit

See component for more information.

API

trigger(el, name, options)

Triggers the name event on el. Options may be passed in to customize the event.

HTMLEvents support the following options:

bubbles
cancelable

MouseEvents support the following options:

bubbles
cancelable
detail (number of clicks)
screenX / screenY
clientX / clientY
ctrlKey
altKey
shiftKey
metaKey
button (mouse button)

See the W3C Event Spec for more details.

Where sensible, sane defaults will be filled in. See the list of event types for supported events.

Attribution

This is loosely based on kangax's event.simulate.js.

License

MIT


Adam Sanderson - http://monkeyandcrow.com

trigger-event's People

Contributors

adamsanderson avatar

Watchers

Tim Kevin Oxley avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.