javaSCRIPT help needed!
- Started
- Last post
- 13 Responses
- cookie
whoops!
Heya!
Have got a series of random images placed next to each other. Each set of random images opens a new window when clicked on.
While this is all working well offline when I test it online the images in all but one of the groups will not display - as well as the image they link to!
I'm sick of fiddling with this and am desperate for an idea of what to do! Any help would be greatly appreciated!
I've posted a mockup idea of the same thing here:
http://populationindex.beauchamp…
(It's not the actual site i'm working on!!!)
If anyone could take a quick squizzy that'd be great!!
- frankbb0
i have just tried this script to find out if it was getting the array value..
var thePics = new Array()
thePics[0] = "images/photos/002_blueflowers_t...
thePics[1] = "images/photos/002_blueflowers_t...for(i=0;i<=50;i++){
var rn = Math.floor(Math.random() * thePics.length)
document.write(thePics[rn]+'');
}seems to be fine, but I would start adding stuff to the array at 0 and not at 1..
- frankbb0
also can you not just have one array with the all the images in that array, would be cleaner..
that way you could do a random thing and plus what ever to the array..
or if you want to just change the array name for each image.. you are over writting the array everytime, i don't think that is good practice...
- cookie0
heya frankbb!
Thanks a bunch for that!
Yeah I'm a bit of a hack when it comes to javascript but i'll go try out what you said now.
Thanks again!!
- unknown0
did it work?
- cookie0
hey Repus,
Nah I didn't get it to work - tried a few variations. Am still pretty new to javascript so it's hard to tinker when you don't know how to!
Yea it was working better before the changes. Really what I'd done seemed to work it just didn't online!
I'm not sure - do you think it could have something to do with defining the array correctly?
I really haven't organised the code very well - i've really just made it for one then copied for the others which is probably where half my problems are coming from!
If anyone knows how to correctly fit the photos to the window that'd be cootah as well!! :)
Thanks for the help!
- unknown0
well I just started looking at ur code ... there are things in my opinion that should'nt be done in JS ... if u have time ... msn me
seb.richer@videotron.ca
Ill fiddle with ur page ... in the mean time .. ill repost maybe later ..
- cookie0
hey repus,
Sorry - don't have msn and don't have a tonne of time at the mo due to excessive work/study etc ! Any ideas you could help us with would be absolutely awesome!! Thanks for the help!
cheers,
- 187LockDown0
well the images are not even there. Thats why they are not showing up.
It's hard to se what you are trying to accomplish.
When a picture doesn't show up, you right click on the X and look at the file name.
- cookie0
Hey,
That's where the problem is!
The pictures are there but they just won't show.
Is it something to do with how I'm labelling the array?>
Any help would be great.
- cookie0
*bump!*
Yea - Still haven't got this working!
Suggest i ons?
:)
- mitsu0
someone had a similar question yesterday. see if my solution works for ya:
http://www33.brinkster.com/trans…
or are you wanting the window sizing animation too?
- n_m0
cookie, there are a few things wrong with your javascript. somethings are wrong, and somethings are just 'not the done thing'.
HOWEVER, the reason your pictures don't display is a litte embarrassing really - you used a mixture of lower and uppser case in the files names, and all lowercase in yoour javascript.
so, for example, your javascript is looking for:
(melbourne)
but your file is called:
(Melbourne)
a bit of a f##k up really, but at least its solved now. good luck.
- cookie0
n_m
you are the best.
(i am just a hack so I'm not TOO embarrassed - but ahh yea Let's let this thread die nice and quick ok! ;) )
Thanks again!
(thanks to others too!)
