The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
I'm trying to get random images up, any help would be brilliant. By the way, the spaces aren't actually there, just because of SR's length restrictions. Thanks!
RiCkOsS
-----
Displaying a Random Image and Hyperlink
Want to randomly display images and hyperlinks from a list? No problem, you can do it with a simple script like the one shown here. No need to learn server-side scripting, or slow down your pages with full-blown Java applications.
The script shown below randomly loads an image from the list you input each time a page is loaded into a browser. This example works with two images. You can add as many as you like. You can even add the same image twice to double its weighting. For example, if you have two images and would like one to be shown twice as much as the other one, simply add the preferred image twice (to total three images in all).
Here's the Script Code. All you have to do is replace the variable "imagenumber" with the correct amount of images you're using. Be sure to label each image with its corresponding number in the images array. Then do the same for the corresponding links. You can also control your image attributes in the display portion of this script, which begins with "document.write" ...
That's it. Load in your info, place the code where you want the images/links to display, refresh the page and watch what happens!
Naturally, you'll have to do a bit of editing to get your own images and links in place. Be sure to keep the imagenumber in sync with however many images and links you wish to use.
> Shouldn't the function random_page() line be function random_image()
> because i don't want the page to be random,just the image. Whenever i
> load up the page it seems to re-direct to my pop-up.
lol. no, the function name has no bearing on what loads - you can rename it to random_image() if you want...
> That script has a lot of page functions (not that I know much
> about Javascript)
lol. it has 2.
I'm trying to get random images up, any help would be brilliant. By the way, the spaces aren't actually there, just because of SR's length restrictions. Thanks!
RiCkOsS