I have a problem, in chrome it runs well, but it won't fire in firefox
function normalizeEvent(e){
if(e.originalEvent instanceof TouchList){
do somethings
}
}
and here is message error: ReferenceError: TouchEvent is not defined
if(e.originalEvent instanceof TouchEvent){}
I have a problem, in chrome it runs well, but it won't fire in firefox
function normalizeEvent(e){
if(e.originalEvent instanceof TouchList){
do somethings
}
}
and here is message error: ReferenceError: TouchEvent is not defined
if(e.originalEvent instanceof TouchEvent){}
Share
Improve this question
edited Dec 5, 2014 at 10:34
Stijn Bernards
1,09111 silver badges29 bronze badges
asked Dec 5, 2014 at 10:12
Le ToanLe Toan
2311 gold badge3 silver badges7 bronze badges
1 Answer
Reset to default 22To get this work in FF, just add window.TouchEvent
condition (is it defined):
if(window.TouchEvent && e.originalEvent instanceof TouchEvent){}