T
Trevor L.
BlankHello to all the wonderful experts out there.
This may not be strictly a FrontPage question, it is more an HTML/Javascript question,
but I don't know whether there is a more specialised Newsgroup for this type of query.
I have a table like this (there are many more entries)
<table>
<tr>
<td>
<a href="#1"
onclick="... (action) ...">
<img src="images/blank.gif" name="Thumbs1" alt=""><br>
Collage<br>
(mainly<br>
Kate's<br>
Family)
</a>
</td>
........
</tr>
</table>
I have written Javascript to alter the image displayed as follows
function PreLoadThumbs()
{ var ThumbnailsImg = new Array() ;
for (i = 0; i < Thumbnails.length; i++)
{ ThumbnailsImg = new Image() ;
ThumbnailsImg.src = Thumbnails ;
document.images["Thumbs" + (i + 1)].src = ThumbnailsImg.src; }
(where Thumbnails is a global text array of the thumbnail names
e.g.var Thumbnails = new Array("images/thumbnails/family-pictures.jpg" ,
... ) ;
I would like to be able to do exactly the same for the captions as for the images,
so I have set up an array of caption names
e.g var Captions = new Array("Collage<br>(mainly<br>Kate's<br>Family)" ,
...);
I can put the following code in place of the actual caption and it works
<script type="text/javascript">document.write(Captions[0])</script>
However, I would prefer to do it the same way as the images
i.e. refer to the HTML element and then assign the corresponding element of array Captions to that HTML
something like
document.text["Caption" + (i + 1)] = Captions; }
How do I refer to this element of the HTML?
I am sure I need something other than document.text
--
Thanks,
Trevor L.
I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
This may not be strictly a FrontPage question, it is more an HTML/Javascript question,
but I don't know whether there is a more specialised Newsgroup for this type of query.
I have a table like this (there are many more entries)
<table>
<tr>
<td>
<a href="#1"
onclick="... (action) ...">
<img src="images/blank.gif" name="Thumbs1" alt=""><br>
Collage<br>
(mainly<br>
Kate's<br>
Family)
</a>
</td>
........
</tr>
</table>
I have written Javascript to alter the image displayed as follows
function PreLoadThumbs()
{ var ThumbnailsImg = new Array() ;
for (i = 0; i < Thumbnails.length; i++)
{ ThumbnailsImg = new Image() ;
ThumbnailsImg.src = Thumbnails ;
document.images["Thumbs" + (i + 1)].src = ThumbnailsImg.src; }
(where Thumbnails is a global text array of the thumbnail names
e.g.var Thumbnails = new Array("images/thumbnails/family-pictures.jpg" ,
... ) ;
I would like to be able to do exactly the same for the captions as for the images,
so I have set up an array of caption names
e.g var Captions = new Array("Collage<br>(mainly<br>Kate's<br>Family)" ,
...);
I can put the following code in place of the actual caption and it works
<script type="text/javascript">document.write(Captions[0])</script>
However, I would prefer to do it the same way as the images
i.e. refer to the HTML element and then assign the corresponding element of array Captions to that HTML
something like
document.text["Caption" + (i + 1)] = Captions; }
How do I refer to this element of the HTML?
I am sure I need something other than document.text

--
Thanks,
Trevor L.
I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html