Skip to content

Instantly share code, notes, and snippets.

@eallegretta
Created December 26, 2018 18:17
Show Gist options
  • Save eallegretta/d9515f1e56c7e5864cb102f788e09734 to your computer and use it in GitHub Desktop.
Save eallegretta/d9515f1e56c7e5864cb102f788e09734 to your computer and use it in GitHub Desktop.
styles = '.btn-navigation { position: absolute !important; z-index:999 !important; right: 50px !important; background-color: greenyellow !important; bottom: -610px !important; } .ui-orientation-warning { display: none !important; } .with-fifa-header .view-root { height: 100%25 !important; } #FIFAHeader { display: none; }';
newSS = document.createElement('style');
newSS.innerText = styles;
document.documentElement.childNodes[0].appendChild(newSS);
var dme = function(t) {
var e = document.createEvent("MouseEvents");
e.initEvent.apply(e, Array.prototype.slice.call(arguments, 1));
t.dispatchEvent(e);
};
var md = 'mousedown';
var mu = 'mouseup';
document.body.onkeydown = function(e) {
console.log(e);
var b1 = $(".decrement-value")[0];
var b2 = $(".increment-value")[0];
var b3 = $(".decrement-value")[2];
var b4 = $(".increment-value")[2];
if (e.key == 'ArrowUp') { dme(b1, md); dme(b1, mu); }
else if (e.key == 'ArrowDown') { dme(b2, md); dme(b2, mu); }
else if (e.key == 'ArrowLeft') { dme(b3, md); dme(b3, mu); }
else if (e.key == 'ArrowRight') { dme(b4, md); dme(b4, mu); }
};
void 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment