Click to See Complete Forum and Search --> : Changing Images Evry Visit
barcode
03-26-2003, 11:26 AM
hey there dougy here i realy need sum help....
on my intro page i have a image (will have) and i want a code so that it will alternate through the images like 1 time its 1 pic then next time they visit its a diffrent picture please will sum 1 help
barcode
03-26-2003, 11:29 AM
bump
lora_3677
03-26-2003, 11:31 AM
Check this out to see if it would work:
http://javascript.internet.com/miscellaneous/random-image.html
DaveSW
03-26-2003, 11:32 AM
Or modify this one:
http://javascript.internet.com/miscellaneous/random-click-image.html
who's dougy by the way?
dave
lora_3677
03-26-2003, 11:33 AM
This one changes the image daily......
http://javascript.internet.com/page-details/week-day-image.html
I found both of these by searching at : http://javascript.internet.com
barcode
03-26-2003, 11:34 AM
hey thx both of u n im dougy :-D
DaveSW
03-26-2003, 11:49 AM
Oh right - i see. I wondered if there was someone you particularly wanted to solve the problem... 'hey there dougy' didn't read the next word!!
dazed&confuzed
03-26-2003, 05:13 PM
I'm also attempting to do this very thing, with little success.
I've tried the random image JavaScript from this site but my images don't appear on screen. All I get is the little red x that shows when an image source file is missing.
I need help in sorting this out!!
Also, can I use jpgs or swf files instead of gif files in this script (assuming I get it working).
One last thing, where do the image files have to be in relation to the page the script appears on. Should they reside in the same folder, how does the script locate the images?
Does any of this make sense to anyone?
Cheers
lora_3677
03-27-2003, 07:00 AM
I have found that the easiest way is to put the images in the same folder, but they don't have to be. Where the images are inserted in your code, you have to put the entire path if they aren't in the same folder.
It sounds like you don't have the path coded correctly for your images. The box with the little red box is signs of an image that failed to load, as you mentioned. Most of the time when I get that it's because I typed the filename wrong or the wrong path...
You should be able to use anytype of image you want.. but I haven't personally tried this code.
Does that help??
Good Luck!!
dazed&confuzed
03-27-2003, 04:30 PM
Thanks lora_3677 I've got something working, what I realised I really need is each for image to have its own url, so when image 1 appears and is clicked it takes you to the site regarding image 1 and so on for each other image.
That's why I asked if .swf files could be used as I can build the link into the image, but so far I've just got the .gif on a random image.
Any ideas on random images with their own links?
Once again, many thanks. I'm new to this JavaScript thing and I am indeed dazed & confuzed by it all!!!
lora_3677
03-28-2003, 06:56 AM
sorry, clueless on the random images with own links. i would try searching javascript.internet.com and maybe just do a search at google.
if i run across anything, i'll let you know.
i'm fairly new to javascript myself.. had a class on it, been about 9 months since i used it... crash coursing myself back into it. ha ha.
DaiWelsh
03-28-2003, 07:46 AM
It is certainly possible to randomise the link as well as the image, but to save me writing it all long hand perhaps you could show your existing random image code and I can help you from there.
wrt jpg and swf, the jpg should be no problem as that is also included into an html page in exactly the same way as a gif (i.e. an <img...> tag), but a swf I believe is included using <object..> syntax or similar? (dont use it myself) so you could not simply repoint an <img..> tag at a swf and expect it to work.
HTH,
Dai