[NewsScroller]

[Kompatibilität]

[zwischen <HEAD> und </HEAD>]

<script language="JavaScript">

<!-- Original:  Pete Thompson (thompp@globalnet.co.uk) -->
<!-- Web Site:  http://www.users.globalnet.co.uk/~thompp -->

<!-- Begin
// news ticker function
var newslist=new Array();
var cnt=0;   // current news item
var curr = "";
var i=-1;   // current letter being typed

newslist[0]=new Array("Check out this JavaScript!","")
newslist[1]=new Array("Use this JavaScript to post news items on your Web site","dummy.htm")
newslist[2]=new Array("Create a list of specials for the day","")
newslist[3]=new Array("Visit JavaScript Source","")
newslist[4]=new Array("The links can even be linked to other pages","")

function newsticker()
{

// next character of current item

if (i < newslist[cnt][0].length - 1)

{
    i++;
    temp1 = newslist[cnt][0];
    temp1 = temp1.split('');
    curr = curr+temp1[i];
    temp2 = newslist[cnt][1];
    mtxt.innerHTML = "<small><a href='"+temp2+"'><font color='#ff0000'>"+curr+"_</small></font></a>";
    setTimeout('newsticker()',10)
    return;

}

// new item

i = -1; curr = "";

if (cnt<newslist.length-1)
    cnt++;

else
    cnt=0;

setTimeout('newsticker()',3000)
}
//  End -->
</script>

[in den <BODY> Tag]

onLoad="newsticker()"

[zwischen <BODY> und </BODY>]

<small>
<span id="mtxt" style="position:relative;top:1px;padding:5px 5px 5px 5px;font-family:Arial;font-size:10pt;width:100%;overflow:auto;height:50px">
</span>

[Autor]

Pete Thompson

[Download]

Kopieren Sie bitte den Code

Copyright © 1998- Nightfire Webworker Archiv Script No: 0201