No normal browser/computer has enough power to deal with that many
elements without getting slow. The fastest way to do it would be
something like this (array join, append a single element, use
innerHTML directly):

var html = [], i = 0;
html[i++] = '<div id="container">';
for(var ln = 500*500;i < ln; i++) {
   html[i] = '<div></div>';
};
html[i++] = '</div>';
$('body')[0].innerHTML =  html.join('');

There are more appropriate technologies to do this, like Flash or
Canvas as mentioned.

cheers,
- ricardo

On Mar 29, 11:11 am, Shedokan <shedo...@yahoo.com> wrote:
> I am trying to create something like ms paint in jquery and I want it
> to support 1000X1000 and that's a lot of pixels(one million to be
> exact).
>
> each pixel is a div so I need a way for handling that much divids.
>
> I currently map an array as an image and then create an element for
> each pixel.
>
> but it takes a lot of time and in an image of 500X500.
>
> please help.

Reply via email to