Trigger cross-browser DOM events. Works with Browserify and as a standalone.
NPM
npm install tiny-trigger --save
Bower
bower install tiny-trigger --save
<script src="/bower_components/tiny-trigger/dist/tinytrigger.min.js"></script>
Browserify
var trigger = require('tiny-trigger');
document.querySelector('.some-element').addEventListener('click', function (e) {
//
});
trigger('.some-element', 'click');
Browser
var trigger = window.tinyTrigger;
document.querySelector('.some-element').addEventListener('click', function (e) {
//
});
trigger('.some-element', 'click');
selector
- css selector OR DOM element OR array of DOM elementsevent
- the name of the event to triggermultple
- if passing in a css selector, should the function find one element or all the elements that match the selector (querySelector vs querySelectorAll)
Requires Phantomjs is installed
npm install
npm test