hey trying make rectangles clickable. after worked whanted , when click on rectangle shows data in div's. @ moment data in canvas div's manual. possible script have whant or should start again make completly different ???
for (var = 0; < rects.length; i++) { if (x > rects[i][0] && x < rects[i][0] + rects[i][2] && y > rects[i][1] && y < rects[i][1] + rects[i][3]) { alert('rectangle ' + + ' clicked'); } }
this had. don't know how change alert whant.
(for whole html page )
setting innerhtml
on div
work:
for (var = 0; < rects.length; i++) { if (x > rects[i][0] && x < rects[i][0] + rects[i][2] && y > rects[i][1] && y < rects[i][1] + rects[i][3]) { var container = document.createelement("span"); span.innerhtml = 'rectangle ' + + ' clicked'; document.getelementbyid("display").appendchild(span); } }
Comments
Post a Comment