|
Hi All:
I'm having a couple of issues and I'm not sure how to proceed and hoping someone can help...
I have an random image/link swap array which is working but only on subsequent visits or on refresh.
Here's that portion of the code:
function disp_links(number) {
for (i=1;i<=number;i++) {
var k = Math.floor(Math.random()*links.length);
document.write(links[k]);
}
}
function disp_links2(number) {...
function disp_links3(number) {...
And the Display code for that function:
disp_links(1);
What I'm try to make happen is after every 10 seconds the images/links change.
I've tried adding the following code to the calculation function which after the interval the images changed but the rest of site went away:
setTimeout((function (n) {
return function () {
disp_links(n);
};
})(number), 10000);
So I have two thoughts, its either the document.write() statement causing the rest of the site to disappear or set timeout statement should be down in the Display code.
I have exhausted my knowledge and could use some help...
|