Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(function ($) {
- var randit = function (l, h) {
- return l + Math.floor(Math.random() * (h-l));
- };
- var rchar = function () { return String.fromCharCode(randit(33,126)); };
- var bloobs = [];
- setInterval(function () {
- var b = $('<div></div>')
- b.css({
- width: '30px',
- position: 'fixed',
- top: '0%',
- textAlign:'center',
- left: randit(0,98) + '%',
- color: 'green',
- });
- b.html(rchar());
- b.animate({top: '100%', opacity: 0}, randit(1500, 5000), function () {
- $(this).remove();
- });
- bloobs.push(b);
- $('body').append(b);
- }, matrix_speed);
- setInterval(function () {
- var remove = [];
- for (var i=0; i<bloobs.length; i++) {
- if (bloobs[i].parents().length == 0) remove.push(i);
- else {
- bloobs[i].html(rchar());
- }
- }
- for (i=(remove.length-1); i>=0; i--) {
- bloobs.splice(remove[i], 1);
- }
- }, 500);
- });
Advertisement
Add Comment
Please, Sign In to add comment