examples/common/touch-emulator.js
function fakeTouchSupport() {
        var objs = [window, document.documentElement];
        var props = ['ontouchstart', 'ontouchmove', 'ontouchcancel', 'ontouchend'];

        for(var o=0; o<objs.length; o++) {
            for(var p=0; p<props.length; p++) {
                if(objs[o] && objs[o][props[p]] == undefined) {
                    objs[o][props[p]] = null;
                }
            }
        }
    }
function fakeTouchSupport() {
        var objs = [window, document.documentElement];
        var props = ['ontouchstart', 'ontouchmove', 'ontouchcancel', 'ontouchend'];

        for(var o=0; o<objs.length; o++) {
            for(var p=0; p<props.length; p++) {
                if(objs[o] && objs[o][props[p]] == undefined) {
                    objs[o][props[p]] = null;
                }
            }
        }
    }
function fakeTouchSupport ( ) { var objs = [ window , document . documentElement ] ; var props = [ 'ontouchstart' , 'ontouchmove' , 'ontouchcancel' , 'ontouchend' ] ; for ( var o = 0 ; o < objs . length ; o ++ ) { for ( var p = 0 ; p < props . length ; p ++ ) { if ( objs [ o ] && objs [ o ] [ props [ p ] ] == undefined ) { objs [ o ] [ props [ p ] ] = null ; } } } }
Simple trick to fake touch event support
this is enough for most libraries like Modernizr and Hammer
Simple trick to fake touch event support this is enough for most libraries like Modernizr and Hammer