This module is included in phonon-core.js.
require(['phonon-core'], function(phonon)) {
phonon.onReady(function() {...});
});
Phonon has its own tap event that is compatible both on browser and touch enabled devices.
document.querySelector('.element').on('tap', handler);
There is a global onReady event that is called when Phonon is ready.
phonon.onReady(function() {
});
The on function is a shortcut for addEventListener.
document.querySelector('.element').on('click', handler);
document.querySelector('.element').on('tap', handler);
It also works with a NodeList.
document.querySelectorAll('.elements').on('tap', handler);
The off function is a shortcut for removeEventListener.
document.querySelector('.element').off('click', handler);
document.querySelector('.element').off('tap', handler);
It also works with a NodeList.
document.querySelectorAll('.elements').off('tap', handler);
document.on('pagecreated', function(evt) {
console.log(evt.detail.page + ' is opened for the first time (created)');
});
document.on('pageopened', function(evt) {
console.log(evt.detail.page + ' is opened');
});
Returns the functional event working with the browser/WebView.
phonon.event.animationEnd; // example: webkitAnimationEnd
Returns the functional event working with the the browser/WebView.
phonon.event.transitionEnd; // example: webkitTransitionEnd