Управление сценариями просмотра Web-страниц


Пример 3.1


<HTML>
<!- ady@demos.su, Saturday, January 20, 1996 7:23:31 PM->
<!- Demos WWW cover page ->
<HEAD>
<TITLE>Welcome to Demos Company - Moscow, Russia</TITLE>
<!- yet another scroller.
(C) 1996 Dmitry Altukhov, ady@demos.su ->
<!-
Use this code for whatever purposes... provided that you retain the copyright notice.
I accept no responsibility for any disasters caused by this monster.
Cannot guess any other cool places for scrollers. And MSIE marquee emulation in JS?!
Er... Mozilla clears windows too slow in JS...
->
<SCRIPT LANGUAGE="JavaScript">
<!- roll it
var rate, pos=0;
function roll(){
var loop, top, msg1;
var msg="Hello World";
for(var i=0; i<10; i++){
msg = msg + (" Hello World");
}
//move on, make a scrolly... and who said that
//scrollers suck?! ;-)
top=(130/msg.length)+1;
for(loop=0; loop<top; loop++) msg+=""+msg;
msg1=msg.substring (pos, pos+130);
window.defaultStatus=msg1;
if (pos++ == 130) pos=0;
//come on, the poor thing can"t roll any faster... buy a Ferrari. ;-)
rate=setTimeout("roll()",30);
}
// that"s all folks ;-)
// end ->
</SCRIPT>
</HEAD>
<BODY BACKGROUND="back.gif" BGCOLOR="#FFFFFF" TEXT="#000040" LINK="#000080"
VLINK="#400080" ALINK="#FF0000" onLoad="roll()">
.....
</BODY>
</HTML>



Начало  Назад  Вперед