I am making a UI in this link pluker link using the following code for a function:
function span1(left1, width, id, color11) {
if (id == 1) {
var sum = 0;
if (sum < width)
sum = width;
width5 = left1 + sum;
console.log(width);
} else if (id == 2) {
var sum2 = 0;
left1 = width5;
if (sum2 < width)
sum2 = width;
width1 = left1 + sum2;
} else if (id == 3) {
var sum1 = 0;
if (sum1 < width)
sum1 = width;
left1 = width1;
width2 = sum1 + left1;
} else if (id == 4) {
left1 = width2;
width3 = left1 + width;
} else {
left1 = width3;
}
When the id is changing form 1 to 2 its giving my left1 value as 6620 which is concatenation of left1=66 and width=20. Could you please help me? Thanks in advance.