Created
February 3, 2018 22:25
-
-
Save mars13code/b32c5b89e9c161524002953fb5d3f965 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var go = function (...tabParam) { | |
if (tabParam.length == 1) { | |
var $d = document; | |
var selector = tabParam[0]; | |
console.log(selector) | |
go.tabSelect = $d.querySelectorAll(selector); | |
return go; | |
} | |
}; | |
go.on = function (eventType, action) { | |
for(e of this.tabSelect) { | |
e.addEventListener(eventType, action); | |
} | |
return this; | |
}; | |
go.scroll = function (event) | |
{ | |
console.log('scroll ' + performance.now()); | |
}; | |
go.mousemove = function (event) | |
{ | |
console.log('mousemove ' + performance.now()); | |
}; | |
go("html,body").on("mousemove", go.mousemove); | |
window.addEventListener("scroll", go.scroll); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment