Hy
I want to add a sort of news service to my site. I've a number of
messages, wich I want to be shown in a <marquee> tag. I've found a
simple scrit that generates an random message (wich I've putted in an
array) and the message is shown in an marquee tag. The problem is that
for changing the message, a reload of the page is required. Isn't
there a way to reload the message? Or every time the marquee tag shows
a message, it will be a differrent message? Or perhaps not using the
marquee tag, but another way to scroll text trough a page?
Thanxs in advance
Sven Daems
<SCRIPT LANGUAGE = "JavaScript">
// The Array Function
function makeArray(len) {
for (var i = 0; i < len; i++) this[i] = null;
this.length = len;
}
// This is where the array of text/images/sounds is created.
ideas = new makeArray(22);
ideas[0] = "Message1"
.....
ideas[21] = "Message22"
// The random number generator.
function rand(n) {
seed = (0x015a4e35 * seed) % 0x7fffffff;
return (seed >> 16) % n;
}
var now = new Date()
var seed = now.getTime() % 0xffffffff
</SCRIPT>
</head>
--------------------------------------------
<body background="images/midden_top.jpg">
<marquee>
<SCRIPT LANGUAGE = "JavaScript">
// Where you place this is where the random object will be displayed.
document.write(ideas[rand(ideas.length)])
</SCRIPT>
</marquee>