[Beschreibung]
DHTML-Scroller - in dieser Qualität sonst nur mit Applets realisierbar
[Kompatibilität]
[Code]
<script language="JavaScript1.2"> <!-- var message= new Array() // Geben Sie hier Ihre Texte ein. Die Anzahl ist unbeschränkt! message[0]="Nightfire expandiert weiter!|Das grösste Schweizer Archiv für JavaApplets und -Scripts erweitert sein Angebot ständig. Monatlich werden rund 20 neue Angebote veröffentlicht.|http://www.nightfire.ch" message[1]="Partner gesucht!|Nightfire will sein Angebot vervollkommnen. Gesucht werden hierzu Partnerseiten, die Nightfire's Angebot ergänzen...wir liefern Applets und Scripts, wer liefert den Rest?|http://www.nightfire.ch/java/partners" message[2]="Nightfire Newsletter|Zugegeben, wir freuen uns über jeden Besuch! Aber, wäre es nicht einfacher für Sie, per EMail über unsere Neuheiten informiert zu werden? Tragen Sie sich dazu in unseren Newsletter-Service ein und bleiben Sie damit auf dem Laufenden.|http://www.nightfire.ch/java/newsletter.htm" // Höhe der Scrollerbox (pixels) var scrollerheight=160 // Breite der Scrollerbox (pixels) var scrollerwidth=160 // Abstand zum linken Fensterrand (pixels) var scrollertop=20 // Abstand zum oberen Bildschirmrand (pixels) var scrollerleft=20 // Abstand zwischen Boxrahmen und Text (pixels) var scrollerpadding=10 // Breite des Box-Rahmens (pixels) var backgroundborder=2 // Hintergrundfarbe der Scrollerbox var scrollerbgcolor="DDDDDD" // Schrift-Attribute der Überschriften var font_titleface="Verdana" var font_titlecolor="FF0000" var font_titlesize=1 // Schrift-Attribute der Texte var font_copyface="Verdana" var font_copycolor="660000" var font_copysize=1 // Wartezeit zwischen den Textblöcken (milliseconds) var standstillfix=3000 // Ab hier nichts mehr verändern!! //Browser Sniffer var ns4up = (document.layers) ? 1 : 0; var ie4up = (document.all) ? 1 : 0; var mozup = (!document.all && document.getElementById) ? 1 : 0; var cliptop=0 var clipbottom=scrollerheight-2*scrollerpadding var clipleft=0 var clipright=scrollerheight var i_message=0 var mes_joined var mes_split var contenttext var contentbg var totalheight=scrollerheight*(message.length) var i_height=0 var step=1 var pause=20 var standstillflex=0 function initiate(){ contenttext="<table cellpadding=0 cellspacing=0 border=0 width="+(scrollerwidth-2*scrollerpadding)+">" contenttext+="<tr valign='top'><td height='"+scrollerheight+"'><br></td></tr>" for (i=0;i<=message.length-1;i++) { mes_joined=message[i] mes_split=mes_joined.split("|") contenttext+="<tr valign='top'><td height='"+scrollerheight+"'><a href='"+mes_split[2]+"'><font face='"+font_titleface+"' color='"+font_titlecolor+"' size='"+font_titlesize+"'>"+mes_split[0]+"</font></a><br><font face='"+font_copyface+"' color='"+font_copycolor+"' size='"+font_copysize+"'>"+mes_split[1]+"</font></td></tr>" } contenttext+="</table>" contentbg="<table cellpadding=0 cellspacing=0 border="+backgroundborder+" width='"+scrollerwidth+"'><tr><td height='"+scrollerheight+"' bgcolor="+scrollerbgcolor+"> </td></tr></table>" if (ie4up) { scrollertext.innerHTML=contenttext scrollerbg.innerHTML=contentbg document.all.scrollertext.style.posTop=scrollertop document.all.scrollertext.style.posLeft=scrollerleft document.all.scrollerbg.style.posTop=scrollertop-scrollerpadding document.all.scrollerbg.style.posLeft=scrollerleft-scrollerpadding document.all.scrollertext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")" } if (ns4up) { document.scrollertext.document.write(contenttext) document.scrollertext.document.close() document.scrollerbg.document.write(contentbg) document.scrollerbg.document.close() document.scrollertext.top=scrollertop document.scrollertext.left=scrollerleft document.scrollerbg.top=scrollertop-scrollerpadding document.scrollerbg.left=scrollerleft-scrollerpadding document.scrollertext.clip.left=clipleft document.scrollertext.clip.right=clipright document.scrollertext.clip.top=cliptop document.scrollertext.clip.bottom=clipbottom } if (mozup) { document.getElementById("scrollertext").innerHTML=contenttext document.getElementById("scrollerbg").innerHTML=contentbg document.getElementById("scrollertext").style.top=scrollertop document.getElementById("scrollertext").style.left=scrollerleft document.getElementById("scrollerbg").style.top=scrollertop-scrollerpadding document.getElementById("scrollerbg").style.left=scrollerleft-scrollerpadding document.getElementById("scrollertext").style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")" } scroll() } function scroll(){ standstillflex=standstillfix if (ie4up){ if (i_height<scrollerheight) { i_height+=step cliptop+=step clipbottom+=step document.all.scrollertext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")" document.all.scrollertext.style.posTop-=step var timer=setTimeout("scroll()",pause) } else { if (document.all.scrollertext.style.posTop<=-(totalheight)) { document.all.scrollertext.style.posTop=scrollertop cliptop=0 clipbottom=scrollerheight-2*scrollerpadding document.all.scrollertext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")" standstillflex=0 } i_height=0 clearTimeout(timer) var timer=setTimeout("scroll()",standstillflex) } } if (ns4up){ if (i_height<scrollerheight) { i_height+=step cliptop+=step clipbottom+=step document.scrollertext.clip.left=clipleft document.scrollertext.clip.right=clipright document.scrollertext.clip.top=cliptop document.scrollertext.clip.bottom=clipbottom document.scrollertext.top-=step var timer=setTimeout("scroll()",pause) } else { if (document.scrollertext.top<=-(totalheight)) { document.scrollertext.top=scrollertop cliptop=0 clipbottom=scrollerheight-2*scrollerpadding document.scrollertext.clip.left=clipleft document.scrollertext.clip.right=clipright document.scrollertext.clip.top=cliptop document.scrollertext.clip.bottom=clipbottom standstillflex=0 } i_height=0 clearTimeout(timer) var timer=setTimeout("scroll()",standstillflex) } } if (mozup){ if (i_height<scrollerheight) { i_height+=step cliptop+=step clipbottom+=step document.getElementById("scrollertext").style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")" document.getElementById("scrollertext").style.top=parseInt(document.getElementById("scrollertext").style.top, 10)-step var timer=setTimeout("scroll()",pause) } else { if (parseInt(document.getElementById("scrollertext").style.top, 10)<=-(totalheight)) { document.getElementById("scrollertext").style.top=scrollertop cliptop=0 clipbottom=scrollerheight-2*scrollerpadding document.getElementById("scrollertext").style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")" standstillflex=0 } i_height=0 clearTimeout(timer) var timer=setTimeout("scroll()",standstillflex) } } } //--> </script>
<style>
A { color:AA0000; }
A:Hover { color:FF0000; }
</style>
onLoad="initiate()"
<div id="scrollerbg" style="position:absolute;top:-1000px"> </div> <div id="scrollertext" style="position:absolute;top:-1000px"> </div>
www.24fun.com modified by N8i (www.nightfire.ch)
kopieren Sie bitte den Quellcode