i used this random function to generate the top and the left position. how do i generate the numbers such that the boxes dont overlap with each other.
this.posX = Math.floor((Math.random() * 850) + 1);
this.posY = Math.floor((Math.random() * 450) + 1);
Fiddle: http://jsfiddle.net/ftw68b6f/2/