Начало
Сообщения
Телетайп Scroller
Теперь Вы можете напечатать текст через экран и затем завиться это от страницы, в то время как это исчезает. Добавьте так много сообщений, как Вы нуждаетесь.
JavaScript Messages: Телетайп Scroller
<!-- THREE STEPS TO INSTALL TELETYPE SCROLLER: 1. Copy the coding into the HEAD of your HTML document 2. Add the onLoad event handler into the BODY tag 3. Put the last coding into the BODY of your HTML document --> <!-- STEP ONE: Paste this code into the HEAD of your HTML document --> <HEAD> <STYLE> .telestyle { position:absolute; visibility:visible; font-size:8pt; font-family:Arial; font-weight:normal; color:#000066; top:300px; left: 60px; height: 32px; width: 500px; filter:alpha(opacity=100); } </STYLE> <SCRIPT LANGUAGE="JavaScript"> <! > <! > <!-- Begin var message = "Try this script today!" var character = 0; var to_print = ""; var ypos = 300; var next = 0 ; var fade = 100 ; var next_message = new Array() ; next_message[0] = "JavaScripts" next_message[1] = "Is your site slow...uninteresting...static? JavaScript™ can bring your pages to life!" next_message[2] = "Add this script to your site!" next_message[3] = "Do your pages take an age to load?" next_message[4] = "Try this script today!" function doText(text) { if (document.all) { if (character <= text.length - 1) { to_print += text.charAt(character); teletext.innerHTML = to_print; character++; } else scrollIt(); } setTimeout("doText(message)", 100); } function scrollIt() { if (ypos >= 260) { ypos -= 1; fade -= 4; if (ypos < 265) { teletext.innerHTML = "" ; } } else { ypos = 300; character = 0; to_print = ""; nextMessage(); fade = 100; } teletext.style.top = ypos; teletext.filters.alpha.opacity = fade; } function nextMessage() { message = next_message[next] if (next == 4) { next = 0; } else next++; } // End --> </script> </HEAD> <!-- STEP TWO: Insert the onLoad event handler into your BODY tag --> <BODY onLoad="doText(message)"> <!-- STEP THREE: Copy this code into the BODY of your HTML document --> <DIV ID=teletext CLASS="telestyle"> </DIV> <!-- Script Size: 2.27 KB -->