I have a jquery code that can draw horizonatal lines.But my problem is no of lines are pre defined.Here is my code
function loadbar()
{
var screensize = 30;
var myarr = Array(screensize).join(("400").concat(","));
var values = ["800","800"];
for (var i in values ) {
var val = values [i];
var width = 2;
var gap = 2;
$('#container').append(
$('<div />').addClass('bar').css({
width: width
, height: val
, left: (width + gap) * i + gap
})
);
}
}
values having no of lines.Say 800 is the height and and i have 2 lines.But I need more lines.If my screen width is 1024 I need to draw 1024 lines.For that I have simple defined a screensize variable and myarr is generating no of times.
but when I use myarr instead of values in for loop it will not display anything.can you guys show me where is the issue?
Thanks