[StatusbarNews]

Ein Statuszeilen- Newsticker

[zwischen <HEAD> und </HEAD>]

<script LANGUAGE="JavaScript">

<!-- Begin
function mklist(n)
{

this.length=n;

for (var c=1 ; c <= n ; c++) {
    this[c]=0;

}

return this;
}

function browserdelay()
{

var retval=500;

if (navigator.userAgent.indexOf("Win") != 0) {
    retval=150;

}

else if (navigator.userAgent.indexOf("Mac") != 0) {
    retval=500;

}

else if (navigator.userAgent.indexOf("X11") != 0) {
    retval=750;

}

return retval;
}

function mkcfg(n)
{

this.num=1;

this.seed=0;

this.list=new mklist(n);

this.type=new mklist(n);

this.delay=browserdelay();

this.timer=0;

this.showurl=(5 * 1000);

this.looping=true;

this.msgdisp=(4 * 1000);

this.barwidth=100;

return this;
}

function urlfix(obj)
{

window.clearTimeout(window.config.timer);

window.defaultStatus=obj.href;

window.config.timer=window.setTimeout("sbprint()",window.config.showurl);

return true;
}

function scrollit_r2l()
{

var out=" ";

var c=0;

  if (window.config.seed <= window.config.barwidth && window.config.seed > 0) {
    for (c=0 ; c < window.config.seed ; c++) {
      out+=" ";
    }
    out+=window.config.list[window.config.num];
    window.config.seed--;
    window.status=out;
    window.config.timer=window.setTimeout("scrollit_r2l()",window.config.delay);

}

else if (window.config.seed <= 0) {
    if (-window.config.seed < window.config.list[window.config.num].length) {
      out+=window.config.list[window.config.num].substring(-window.config.seed,window.config.list[window.config.num].length);
      window.config.seed--;
      window.status=out;
      window.config.timer=window.setTimeout("scrollit_r2l()",window.config.delay);
    }
    else {
      window.status=" ";
      window.config.num++;
      window.config.timer=window.setTimeout("sbprint()",window.config.msgdisp);
    }

}
}

window.config=new mkcfg(7);
window.config.list[1]="You can use this for all types of messages ";
window.config.type[1]=0;
window.config.list[2]="This is great as a news ticker ";
window.config.type[2]=0;
window.config.list[3]="Be sure and visit nightfire.ch ";
window.config.type[3]=0;
window.config.list[4]="You could put daily updates here ";
window.config.type[4]=0;
window.config.list[5]="You could also use this for daily specials or announcements ";
window.config.type[5]=0;
window.config.list[6]="It is not hard to change the messages ";
window.config.type[6]=0;
window.config.list[7]="You ought to try this! ";
window.config.type[7]=0;

function sbprint()
{

if (window.config.num <= window.config.list.length) {
    if (window.config.type[window.config.num] == 0) {
      window.status=window.config.list[window.config.num];
      window.config.num++;
      window.clearTimeout(window.config.timer);
      window.config.timer=window.setTimeout('sbprint()',window.config.msgdisp);
    }
    else if (window.config.type[window.config.num] == 1) {
      window.config.seed=window.config.barwidth;
      scrollit_r2l();
    }

}

else if (window.config.looping) {
    window.config.num=1;
    window.clearTimeout(window.config.timer);
    window.config.timer=window.setTimeout('sbprint()',window.config.delay);

}
}
//  End -->
</script>

[in den <BODY> Tag onload="window.config.timer=window.setTimeout('sbprint()',window.config.delay);"

[Autor]

JavaScriptSource

[Download]

Kopieren Sie bitte den Code

Copyright © 1998- Nightfire Webworker Archiv Script No: 0254