Location: PHPKode > projects > chillyCMS > chillyCMS/modules/newsticker/newsticker.php
<?php defined('DOIT') or die('Restricted access'); ?>
<script type="text/javascript" language="JavaScript">
<!--
var max = 0;
function newselements()
{
	max = newselements.arguments.length;
	for (i=0; i<max; i++) { this[i] = newselements.arguments[i];}
}
ne = new newselements (
//TODO inhalt von Textlist vom Backend aus bestimmbar
"Hallo Welt"
);
var x=0; pos=0;
var l= ne[0].length;
// Funktion, die den Text im Frontend ausgibt:
function ticker()
{
	tickerfeld = document.getElementById("newsticker");
	tickermsg = ne[0].substring(0, pos);
	tickerfeld.innerHTML = ""+ tickermsg +"";
	if(pos < l) {
		pos++;
		setTimeout("ticker()", 100);
	} else {
		pos=0;
		setTimeout("ticker()", 2000);
	}	
	//tl[x] = tl[x].substring(1, tl[x].length) + tl[x].substring(0, 1);
	//tickerfeld.innerHTML = ""+ tl[x].substring(0, pos) +"";
	//document.tickerform.tickerfeld.value=tl[x].substring(0,pos)+"]";
	//if(pos++==l)
	//{
		//pos=0;
		//setTimeout("textticker()",2500); // Pause nach jeder Zeile
		//x++;
		//if(x==max)
			//x=0;
			//l=tl[x].length;
	//} else
		//setTimeout("textticker()",10); // Pause nach der letzten Zeile
		//setTimeout("textticker()",500);
}-->
</script>
<?php
$specialsettings=explode(',@separator@,', $modsettings);
$tickermsg=$specialsettings[0];
$delay=$specialsettings[1];
?>
<marquee class="newsticker" scrolldelay="<?php echo $delay; ?>" scrollamount="3"><?php echo $tickermsg; ?></marquee>
<!--<span id="newsticker" style="color: #ffffff; width: 100%;"></span>
<script type="text/javascript" language="javascript">scroll();</script>-->
Return current item: chillyCMS