blowfish/node_modules/packery/sandbox/examples.js
2023-01-29 22:30:24 +00:00

14 lines
477 B
JavaScript

function appendRandomSizedItems( container ) {
var frag = document.createDocumentFragment();
for ( var i=0; i < 35; i++ ) {
var item = document.createElement('div');
item.className = 'item';
var w = Math.floor( Math.random() * Math.random() * 180 ) + 20;
var h = Math.floor( Math.random() * Math.random() * 180 ) + 20;
item.style.width = w + 'px';
item.style.height = h + 'px';
frag.appendChild( item );
}
container.appendChild( frag );
}