JSFiddle - React, Tailwind, and code Playground
by wesbos
HTML
wat
JavaScript
jQuery(function($) {
$(window).bind('acc', function(e) {
console.log('yeeee works son');
console.log(e);
});
});
jQuery.event.special.acc = {
setup: function(data, namespaces) {
console.log('setup');
var elem = this, $elem = jQuery(elem);
$elem.bind('deviceorientation', jQuery.event.special.acc.handler);
// elem.addEventListener('deviceorientation', jQuery.event.special.acc.handler, false);
},
teardown: function(namespaces) {
console.log('teardown');
var elem = this, $elem = jQuery(elem);
$elem[0].removeEventListener('deviceorientation', jQuery.event.special.acc.handler, false);
},
handler: function(event) {
console.log('event handler!');
var elem = this, $elem = jQuery(elem);
event.type = "acc";
//console.log(arguments);
jQuery.event.handle.apply(this, arguments)
}
};