Here's some code... please, be brutalfunction twisty (elem, container) {    elem = $('.some-elem');    container = $('.container').hide();    var spots = elem.text().replace(' ', '').split('');    for(var i = 0; i < 300; i++) {    $('<span/>', {        'class': 'spot '+ i,        text: spots[Math.ceil(Math.random() * spots.length-1)] ,        css: {            fontSize: Math.ceil(Math.random() * 50),            left: Math.ceil(Math.random() * 1000),            top: Math.ceil(Math.random() * 30),            bottom: Math.ceil(Math.random() * 50),            opacity: Math.random() / 3,            color: 'rgb('+ Math.ceil(Math.random() * 70) + ',' +                           Math.ceil(Math.random() * 70) + ',' +                           Math.ceil(Math.random() * 70) + ')',            transform: 'rotate(' + Math.ceil(Math.random() * 360)  + 'deg)'        }        }).appendTo(container.fadeIn(800));    }}jQuery(document).ready(function($) {twisty();$('.some-elem').on('click', function(){    $('.container').hide();    $('span.spot').remove();    twisty();});});Here's the html<div class=content>    <h2 class=some-elem>hello world<div class=container></div></h2></div>Here's a link to the fiddle outputProbably not the most useful piece of code, but some things I'm trying to learn are:How to extend native javascript objects (so how could i minimize theexcessive use of calling Math.random)How to make my code as clean and as portable as possibleHow to animate stuffHow to do all of the above without using jQueryHow to extend jQueryBut mostly, I'm looking for feedback :] edit: fixed so it actually fades in(updated link to include some css, cause the transform prop wasn't working)
Here is a function I wrote that, with the help of jQuery, will randomize a bunch of properties
javascript;jquery