Начало
Сообщения
Текст Rotater
Автоматически вращает ряд сообщений в пределах слоя или отделения, основанного на браузере пользователя.
JavaScript Messages: Text Rotater
<!-- ONE STEP TO INSTALL TEXT ROTATER: 1. Copy the coding into the BODY of your HTML document --> <!-- STEP ONE: Paste this code into the BODY of your HTML document --> <BODY> <SCRIPT LANGUAGE="JavaScript"> <! > <! > <!-- Begin var beforeMsg = "<center><font color=blue size=+2><b>"; var afterMsg = "</b></font></center>"; var msgRotateSpeed = 2000; // Rotate delay in milliseconds var textStr = new Array(); textStr[0] = "Check out this script!"; textStr[1] = "Why not add it to your page?"; textStr[2] = "W3C-DOM compatible (NS6)"; textStr[3] = "You are using "+navigator.userAgent; if (document.layers) { document.write('<ilayer id="NS4message" height=25 width=100%><layer id="NS4message2" height=25 width=100%></layer></ilayer>') temp = 'document.NS4message.document.NS4message2.document.write(beforeMsg + textStr[i++] + afterMsg);'+ 'document.NS4message.document.NS4message2.document.close()'; } else if (document.getElementById) { document.write(beforeMsg + '<div id="message" style="position:relative;">IE division</div>' + afterMsg); temp = 'document.getElementById("message").firstChild.nodeValue = textStr[i++];'; } else if (document.all) { document.write(beforeMsg + '<div id="message" style="position:relative;">IE division</div>' + afterMsg); temp = 'message.innerHTML = textStr[i++];'; } var i = 0; function msgRotate() { eval(temp); if (i == textStr.length) i = 0; setTimeout("msgRotate()", msgRotateSpeed); } window.onload = msgRotate; // End --> </script> <!-- Script Size: 1.76 KB -->