1
I’m starting in jquery and I’m having trouble touching for this function, it doesn’t 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;
}
Please avoid long discussions in the comments; your talk was moved to the chat
– Maniero