For the moment, I have this
var x = 150;
var o = 100;
var canvas = $('#NodeList').get(0);
var ctx = canvas.getContext('2d');
ctx.strokeStyle = "red";
canvas.height = 0;
var rects = [
[20, 20, x, o],
[20, 130, x, o],
[20, 240, x, o],
[20, 350, x, o],
[20, 460, x, o],
[20, 570, x, o],
[20, 680, x, o],
[20, 790, x, o],
[20, 900, x, o]
];
as you can see i have added manually every rectangle.
I want to add automatically 70 pixels by each rectangle added by uses a jQuery function drawRect()
.
I have tried this so far Jcanvas
My reason for this is that i want to load data into an other canvas by clicking on the rectangle in this "canvas". I think it would be easier by using JQuery drawRect()
instead of typing it manually like I did below. Since the rectangles dont have any ID.
I am stuck can you please clearify things for me?