Hejsa..
Denne her er lidt federe end en scrollende tekst...
I head placere du:
<script type="text/javascript">
function snapIn(jumpSpaces,position) {
tp=0;
var msg=new Array();
msg[0] = "DIN TEKST HER!!!";
var out = "";
if (killScroll) return false;
for (i=0;i<position;i++) out += msg[tp].charAt(i);
for (i=1;i<jumpSpaces;i++) out += " ";
out += msg[tp].charAt(position);
window.status = out;
if (jumpSpaces <= 1) {
position++;
if (msg[tp].charAt(position) == ' ') position++;
jumpSpaces = 100-position;
} else if (jumpSpaces > 3) jumpSpaces *= .75;
else jumpSpaces--;
if (position != msg[tp].length) {
var cmd = "snapIn(" + jumpSpaces + "," + position + ")";
scrollID = window.setTimeout(cmd,4);
} else {
scrolling = false;
return false;
}
return true;
}
function snapSetup() {
if (scrolling) if (!confirm('Re-initialize snapIn?')) return false;
killScroll = true;
scrolling = true;
var killID = window.setTimeout('killScroll=false',6);
scrollID = window.setTimeout('snapIn(100,0)',10);
return true;
}
var scrollID = Object;
var scrolling = false;
var killScroll = false;
</script>
Og i Body placere du <body onload="snapSetup()">
Hvis du hellere vil have en normal scrollende tekst skal du:
Placere denne tekst under Head
<script type="text/javascript">
function scrolltekst(count) {
var msg = "SKRIV DIN TEKST HER!!!";
var out = " ";
var c = 1;
if (count > 100) {
count--;
cmd="scrolltekst("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (count <= 100 && count > 0) {
for (c=0 ; c < count ; c++) {
out+=" ";
}
out+=msg;
count--;
window.status=out;
cmd="scrolltekst("+count+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (count <= 0) {
if (-count < msg.length) {
out+=msg.substring(-count,msg.length);
count--;
window.status=out;
cmd="scrolltekst("+count+")";
timerTwo=window.setTimeout(cmd,100);
}
else {
window.status=" ";
timerTwo=window.setTimeout("scrolltekst(100)",75);
}
}
}
// Slut -->
</script>
Og i body:
<body onload="scrolltekst(100)">
Håber det hjælper
Det kan GODT køre i Frontpage... (skulle jeg mene..)