English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I found this piece of code, but i'm clueless when it comes to suc things ...


=============================
part 1
============================


===========================================
part 2 - put this where you want your image to be
===========================================

2006-11-02 00:29:09 · 5 answers · asked by thedaveidentity 1 in Computers & Internet Programming & Design

5 answers

Well that will do the trick - you'll need to embed these scripts in your HTML page, the first one in the section and the second one at the place you want the image to appear.

In the top one, you should change the text IMAGE #1 etc to the actual locations of your image, eg
images[1] = "http://www.myserver.com/images/myimage1.gif".

2006-11-02 00:38:26 · answer #1 · answered by Daniel R 6 · 0 0

The first point is that this code is copyrighted, so check to make sure you have permission to use it! I assume it comes from a book - does that not give more explanation?

Although I'm not expert, perhaps the following may help.

Firstly, you have to decide what images you are going to choose. The code randomly selects one image from a possible 5 images. If you want more than that, say one from 10 you would have to extend the code to include in part 1 image[6]="IMAGE #6" ... image[10]="IMAGE #10 and also, of course, actually save 10 images! At the start of the code you would have to alter varimagenumber=5 to varimagenumber=10

The hard part is knowing how and where to store your images. Quite often, web sites have a separate folder for images called 'images'. If that is the case for your site, choose that folder. However, I think that the code in Part 2 would have to be changed to 'document write('')

Of course, the Javascript code has to be included together with the HTML code for the page.

Hope this helps

2006-11-02 01:00:39 · answer #2 · answered by Charlie Babbage 5 · 0 0

seems superb to me. making use of Firefox. layout is sparkling and smartly carried out. yet on 2d look, the photograph that reflects for me is 3847 x 2284 pixels. it is WAAAYY too great. i'm in basic terms seeing an excellent left ingredient of it. Your HTML has interior the call for this photograph 640x380 in spite of the incontrovertible fact that that's no longer that length. i think of you forgot to resize the photograph.

2016-10-03 05:03:05 · answer #3 · answered by ? 4 · 0 0

Wave a magic wand...

2006-11-02 00:33:59 · answer #4 · answered by mark leshark 4 · 0 1

Create a folder with images named “n.jpg”, where "n" is a real number from 0 to "p" ("p" is a maximum value) and paste that script to your html code.
------------------------------------------------------------------------------------

------------------------------------------------------------------------------------

2006-11-02 00:52:15 · answer #5 · answered by Anonymous · 0 0

fedest.com, questions and answers