Browse Source

demos : use modulus for randomish size classes

pull/96/head
David DeSandro 13 years ago
parent
commit
3e5dcf512c
  1. 12
      _includes/random-sizes.js

12
_includes/random-sizes.js

@ -1,10 +1,12 @@
// hacky way of adding random size classes // add randomish size classes
$container.find('.element').each(function(){ $container.find('.element').each(function(){
if ( Math.random() > 0.6 ) { var $this = $(this),
$(this).addClass('width2'); number = parseInt( $this.find('.number').text(), 10 );
if ( number % 7 % 2 === 1 ) {
$this.addClass('width2');
} }
if ( Math.random() > 0.6 ) { if ( number % 3 === 0 ) {
$(this).addClass('height2'); $this.addClass('height2');
} }
}); });
Loading…
Cancel
Save