Created
March 7, 2016 11:16
-
-
Save Samsy/b2dc24b1f8694540721f to your computer and use it in GitHub Desktop.
addevents
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
addTouchEvent() { | |
console.log('readd') | |
this.wrapper = document.querySelector('.wrapper') | |
let bla = ["touchstart", "touchend", "touchmove"] | |
bla.forEach( (func)=> { | |
this[func + 'event'] = this[func].bind(this) | |
this.wrapper.addEventListener(func, this[func + 'event'] ) | |
} ) | |
} | |
removeTouchEvents() { | |
let bla = ["touchstart", "touchend", "touchmove"] | |
bla.forEach( (func)=> { | |
this.wrapper.removeEventListener(func, this[func + 'event'] ) | |
} ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment