Hey everyone I was trying to make my rectangles clickable. After it worked i whanted , that when i click on a rectangle that it shows data in the div's. At this moment the data in the canvas div's are manual. Is it possible with the script i have to do what i whant or should I start again but make it completly different ???
for (var i = 0; i < 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 ' + i + ' clicked');
}
}
This is what i had. I don't know how to change the alert into what i whant.
(For the whole html page )
Aucun commentaire:
Enregistrer un commentaire