Touch Event in Jquery [closed]

1

I'm starting in jquery and I'm having trouble touching this function, it does not work on mobile.

$('#font_family').change(function() {
        svgCanvas.setFontFamily(this.value);
});

document.addEventListener("touchstart", touchHandler, true);
document.addEventListener("touchmove", touchHandler, true);
document.addEventListener("touchend", touchHandler, true);
document.addEventListener("touchcancel", touchHandler, true);

function touchHandler(event)
{   

    var touches = event.changedTouches,
        first = touches[0],
        type = "";
         switch(event.type)
    {
        case "touchstart": type="mousedown"; break;
        case "touchmove":  type="mousemove"; break;        
        case "touchend":   type="mouseup"; break;
        default: return;
    }
    
asked by anonymous 05.01.2017 / 13:43

0 answers