JSFiddle - React, Tailwind, and code Playground
by wesbos
HTML
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<title>Demo - </title>
</head>
<body>
<a href="#">wat</a>
</body>
</html>
JavaScript
$(function() {
$(window).bind('acc', function(event) {
console.log(event);
console.log('yeeee');
});
});
jQuery.event.special.acc = {
setup: function(data, namespaces) {
console.log('setup');
var elem = this, $elem = jQuery(elem);
elem.addEventListener('deviceorientation', jQuery.event.special.acc.handler, false);
},
teardown: function(namespaces) {
var elem = this, $elem = jQuery(elem);
$elem.unbind('click', jQuery.event.special.acc.handler);
},
handler: function(event) {
//console.log('event handler!');
console.log(event.beta);
var elem = this, $elem = jQuery(elem);
event.type = "acc";
// let jQuery handle the triggering of "acc" event handlers
//console.log(arguments);
jQuery.event.handle.apply(this, arguments)
}
};