function cross(subEvent) { // ID of clicked image. var canvas = $(subEvent.target).attr("id"); plotInfo = PLOTINFO[canvas]; var info = $(subEvent.target).attr("info"); if (plotInfo == -1) { $("#"+info).html('No metadata found.'); return; } var xx = subEvent.offsetX || ( subEvent.pageX - subEvent.target.offsetLeft ); var yy = subEvent.offsetY || ( subEvent.pageY - subEvent.target.offsetTop ); //console.log(subEvent); var found= false; for ( i=0; i<4; i++ ) { var p= plotInfo.plots[i]; //console.log(p) if ( p.xaxis.left<=xx && xx