jQuery: Creating instances with Javascript

I have been creating instances of objects using Flash Actionscript all this while and yet I have not tried the same application on jQuery/Javascript. Having found some little time to experiment on it and this is an example I managed to try.

The example below dynamically creates 10 div elements and randomly set their coordinates around. One of them is then called by invoking the instance’s function and allocate it to a specific location.

I believe there is a more elegant way to implement this example and if you have a better way than what I’ve done, feel free to educate me. : )

Click here to see the script in action via jsFiddle

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>