How to individually animate random lines of color in jQuery?
<p>So far, I have a simple script that checks the size of the document and creates a 1px div for each line in the doc and applies a random color to each line. I want to animate each lines background color individually, so all the lines pulsate and change colors.</p>

<p>Here is my code:</p>

<pre><code>&lt;script type="text/javascript"&gt;
    $(document).ready(function() {
        var pageHeight = $(window).height();
        for(var i = 0; i &lt; pageHeight; i++) {
            $('body').prepend('&lt;div class="myDiv '+i+'"&gt;&lt;/div&gt;');
        };

        $('.myDiv').each(function() {
            var myColor = randomColor();
            //alert (myColor);
            $(this).css("background-color", "rgb(" + myColor + ")");
        });
    });

    function randomColor () {
        var color1 = randomFromTo(100,255);
        var color2 = randomFromTo(200,255);
        var color3 = randomFromTo(0,100);
        return color1 + "," + color2 + "," + color3;
    };

    function randomFromTo(from, to){
        return Math.floor(Math.random() * (to - from + 1) + from);
    }
&lt;/script&gt;

&lt;style&gt;
    body { margin:0; }
    .myDiv { height:1px; }
&lt;/style&gt;
</code></pre>
