help with javascript

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

malice

Thread Starter
Joined
Jun 18, 2003
Messages
56
hi i have this javascript which is supposed to show a series of images on my site

this is the code:


<script language="javascript">
-->
// Set speed (milliseconds)
var speed = 900

// Specifying image files
var Pic = new Array()

img[0] = '0.jpeg'
img[1] = '1.jpeg'
img[2] = '2.jpeg'
img[3] = '3.jpeg'

var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
preLoad = new Image()
preLoad.src = Pic
}

function runimgs(){
if (document.body){
document.body.background = Pic[j];
j = j + 1
if (j > (p-1)) j=0
t = setTimeout('runimgs()', speed)
}
}
// End -->
</script>

in my body tag theres also the onload="runimgs()"

but i always get an error msg saying object expected
can anyone tell me whats wrong?
 
Joined
Jul 29, 2001
Messages
21,334
Are the images in your array actual images on your web site? Might just be a path problem to the image files.
 

malice

Thread Starter
Joined
Jun 18, 2003
Messages
56
nope no problem with path or anything

i wish i could but currently my isp is giving me a hard time
and denied access to the free webspace i have
so i cant do it online its strange i couldnt find any mistake
in this and apparently neither can you.
hmmm 'scratches head'
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top