Měnící se text (2) - ukázka zdrojového kódu zdrojový kód

<html>
<head>
<title>Java Script ze stránky - www.jaknaweb.com</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">

<SCRIPT language=JavaScript><!--
line=new Object()
line[1]="www"
line[2]="jaknaweb.com"
line[3]="vse pro web"
line[4]="php, html, css,..."


lines=4 


document.write('<form name="bannerform">')
document.write('<div align="center"><center><p><input type="text" name="banner" size="47"')
document.write('  style="background-color: #000000; color: #f7f7ff; text-align: center; font-family: verdana; font-size: 14pt; border: medium none" onfocus="blur()"></p>')
document.write('  </center></div>')
document.write('</form>')

temp=""
nextchar=-1;
nextline=1;
cursor="\\"
function animate(){
if (temp==line[nextline] & temp.length==line[nextline].length & nextline!=lines){
nextline++;
nextchar=-1;
document.bannerform.banner.value=temp;
temp="";
setTimeout("nextstep()",1000)}
else if (nextline==lines & temp==line[nextline] & temp.length==line[nextline].length){
nextline=1;
nextchar=-1;
document.bannerform.banner.value=temp;
temp="";
setTimeout("nextstep()",1000)}
else{
nextstep()}}

function nextstep(){
if (cursor=="\\"){
cursor="|"}
else if (cursor=="|"){
cursor="/"}
else if (cursor=="/"){
cursor="-"}
else if (cursor=="-"){
cursor="\\"}
nextchar++;
temp+=line[nextline].charAt(nextchar);
document.bannerform.banner.value=temp+cursor
setTimeout("animate()",25)}


document.onload=animate();
// --></SCRIPT>
</HEAD>
<BODY>

</Body>
</HTML>
Vložil/Poslal/Autor: Admin
Funkčnost: správna funkčnost zaručena pouze v IE 6
zavřít okno | jít na hlavní stránku JakNaWeb.com