var curr = []; function getpos(ev) { curr.push([]); var offset = $("#graphcolumn .draw").offset(); var ptop = $(offset.top).to_em_raw(); var pleft = $(offset.left).to_em_raw(); console.log("drawLineCoord: " + ($(ev.clientX).to_em_raw() - pleft) + "," + ($(ev.clientY).to_em_raw() - ptop)); } function getnode(ev) { console.log($(ev.currentTarget).attr('data-id')); }