Background Effects >>> Matrix.
Script Categories


Background Effects >>> Matrix.

Simulate the Matrix by choosing one of the links. The window closes after the whole string is printed.

Normal text
Bold text
Italic text
Bold and italic text
Normal string constant

Add the below code to the <body> section of your page:

<!-- Original:  Matt Lewis ( -->
/* Visit for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
var matrix_window;
function MatrixWrite(string, bold, italic, speed) {
var Height = window.screen.height;
var Width = window.screen.width;
var win_dimensions = "Height = " + eval(Height + 10) + ", Width = " + eval(Width + 30);
matrix_window ="blank.htm", "matrix_window", win_dimensions);"text/html", "replace");
var i;
var timer = 0;
matrix_window.moveTo(-10, -30);
matrix_window.resizeBy(0, 50);
matrix_window.document.write("<body bgcolor=000000 text=00ff00 onBlur='self.focus()'>");
matrix_window.document.write("<font face=system>");
if(bold == true) matrix_window.document.write("<b>");
if(italic == true) matrix_window.document.write("<i>");
for(i = 0; i <= string.length; i++) {
timer += (Math.random() * speed);
setTimeout("matrix_window.document.write('" + string.charAt(i) + "');", timer);
timer += 2000;
setTimeout("matrix_window.close()", timer);
var messages = new Array("The Matrix has you...", "Follow the white rabbit", "Wake up, Neo");
function GetRndIndex() {
return (parseInt(Math.random() * messages.length));
function WriteRndMsg(bold, italic, speed) {
MatrixWrite(messages[GetRndIndex()], bold, italic, speed);
//  End -->
<table align="center">
<a href="javascript:WriteRndMsg(false, false, 750)">Normal text</a>
<a href="javascript:WriteRndMsg(true, false, 750)"><b>Bold text</b></a>
<a href="javascript:WriteRndMsg(false, true, 750)"><i>Italic text</i></a><br>
<a href="javascript:WriteRndMsg(true, true, 750)"><b><i>Bold and italic text</i></b></a>
<a href="javascript:MatrixWrite('Knock knock, Neo', false, false, 750)">Normal string constant</a>


Code was highlighted by 1st JavaScript Editor (The Best JavaScript Editor!).

[an error occurred while processing this directive]